Strapi v5 - plugin migration https://github.com/marlokessler/strapi-plugin-image-optimizer

Hi,
I’m trying to migrate the awesome plugin GitHub - marlokessler/strapi-plugin-image-optimizer: Optimize your images for desktop, tablet and mobile and different image formats. to work with strapi v5

The build process seems to run fine, but when integration the plugin into my strapi v5 test project I get the following error:

  Error: Could not load js config file /Users/.../strapi-playground-docker/src/plugins/upload-image-optimizer/dist/server/index.js:                                       ││   Something went wrong installing the "sharp" module                                                                                                                             ││                                                                                                                                                                                  ││   Could not dynamically require "../build/Release/sharp-darwin-x64.node". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of                      ││   @rollup/plugin-commonjs appropriately for this require call to work. 

Here is my current code base:

Any hint is much appreciated

This topic has been created from a Discord post (1284507235195682917) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

whenever i see this, i usually delete sharp from /node_modules/@strapi/upload/node_modules/sharp

idk why but this breaks on my mac

then it relies on whatever sharp i have installed globally i think, and it then works