Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagemin-svgo version 10.0.0 compatibility #264

Open
derBlume opened this issue Sep 22, 2021 · 0 comments
Open

imagemin-svgo version 10.0.0 compatibility #264

derBlume opened this issue Sep 22, 2021 · 0 comments

Comments

@derBlume
Copy link

imagemin-svgo introduced a breaking change with the latest version 10.0.0 which breaks compatibility with next-optimized-images. They switched from CommonJS Modules to ESM.

Related issue from the library: imagemin/imagemin-svgo#51

> Build error occurred
122Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: .../node_modules/imagemin-svgo/index.js
123require() of ES modules is not supported.
124require() of .../node_modules/imagemin-svgo/index.js from .../node_modules/next-optimized-images/lib/loaders/img-loader.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
125Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from .../node_modules/imagemin-svgo/package.json.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant