cyrilwanner / next-optimized-images

🌅 next-optimized-images automatically optimizes images used in next.js projects (jpeg, png, svg, webp and gif).
MIT License
2.21k stars 93 forks source link

Compatibility with imagemin-svgo version 9 #232

Open Manc opened 3 years ago

Manc commented 3 years ago

Package imagemin-svgo released a new major version 9.0.0 a few days ago and it is no longer compatible with this plugin.

When trying to build my Next.js project I get an error like this:

Failed to compile.

./xxxxxxxxx/xxxxxxxxxx.svg
Error: Plugin name should be specified
    at Array.map (<anonymous>)

> Build error occurred

Downgrade to 8.0.0 and the project compiles fine. This might be the clue, but I'm not sure how to apply the change here.

ghost commented 3 years ago

I'm having a very similar problem, except my project doesn't use this plugin. This might be more related to nextjs than to this plugin, unless if NextJs 10 suddenly uses this plugin by default and I missed something.

error - ./components/ui/icon/assets/index.tsx
Error: /..../index.tsx: Plugin name should be specified
    at Array.map (<anonymous>)

I'm getting no clues whatsoever what is causing this. The message isn't very helpful. The file it's refering to is importing a couple of .svgs as a helper function.

AhmedBHameed commented 3 years ago

I agree with @stijn-gravity Seems NextJS still struggling with SVGs. Also the error message can be improved.