You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/node_modules/imagemin-svgo/index.js b/node_modules/imagemin-svgo/index.cjs
similarity index 100%
rename from node_modules/imagemin-svgo/index.js
rename to node_modules/imagemin-svgo/index.cjs
When running yarn build I got the same error with the same suggestion your are making or to remove "type": "module" from the package.json file in node_modules/imagemin-svgo/. I decided to go with the first suggestion and changed the index file type of imagemin-svgo to .cjs and now my project is running locally but I am still wondering why did it work and if there will be any impact before releasing it.
Javascript, NodeJS and all the libraries/frameworks derived from or related to them are not my area of expertise so I would really appreciate some insight reggarding this issue.
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch
imagemin-svgo@10.0.0
for the project I'm working on.This fixes a build error with next.js and the
ERR_REQUIRE_ESM
error.https://github.com/vercel/next.js/issues/30307
Here is the diff that solved my problem:
diff --git a/node_modules/imagemin-svgo/index.js b/node_modules/imagemin-svgo/index.cjs similarity index 100% rename from node_modules/imagemin-svgo/index.js rename to node_modules/imagemin-svgo/index.cjs
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: