[Ionic 5] Mac M1 - cordova-res

Hello,

I recently got a Mac M1. I am able to get things to run on both android and ios. My issues is updating the icon/splash screens.

Per Capacitor - build cross platform apps with the web, I have installed cordova-res and run the following:

cordova-res ios --skip-config --copy

Error:
Something went wrong installing the “sharp” module

dlopen(/Users/lester03/.nvm/versions/node/v14.18.1/lib/node_modules/cordova-res/node_modules/sharp/build/Release/sharp.node, 0x0001): Library not loaded: /opt/homebrew/opt/jpeg-xl/lib/libjxl.0.dylib
Referenced from: /opt/homebrew/Cellar/libheif/1.12.0/lib/libheif.1.dylib
Reason: tried: ‘/opt/homebrew/opt/jpeg-xl/lib/libjxl.0.dylib’ (no such file)

If I look at the contents of /opt/homebrew/opt/jpeg-xl/lib I see the following:

libhwy.a | libjxl.dylib | libjxl_threads.dylib
libhwy_contrib.a | libjxl_dec.a | node_modules
libjxl.0.6.1.dylib | libjxl_threads.0.6.1.dylib package-lock.json
libjxl.0.6.dylib | libjxl_threads.0.6.dylib pkgconfig
libjxl.a | libjxl_threads.a

there are versions - > libjxl.0.6.dylib and > libjxl.0.6.1.dylib

so it looks like the sharp version that cordova-res uses has a dependency on /opt/homebrew/opt/jpeg-xl/lib/libjxl.0.dylib which it cannot find referenced from /opt/homebrew/Cellar/libheif/1.12.0/lib/libheif.1.dylib

It looks like cordova-res is using a version 0.27.2 of the sharp module instead of 0.28.0 (see last comment).

https://github.com/lovell/sharp/issues/2460

Can anyone provide details as to get the correct version of dependencies that the cordova-res version of sharp is looking for?

Or what I am doing incorrect?

Thanks!

Looks like it will be resolved shortly.

https://github.com/ionic-team/capacitor-assets/pull/216