ERROR require() of ES Module imagemin-svgo not supported
See original GitHub issueHello, I’m running into this error when trying to use the library.
ERROR require() of ES Module /home/user/workspace/my-app/node_modules/imagemin-svgo/index.js from /home/user/workspace/my-app/node_modules/@aceforth/nuxt-optimized-images/lib/loaders/img-loader.js not supported.
Instead change the require of index.js in /home/user/workspace/my-app/node_modules/@aceforth/nuxt-optimized-images/lib/loaders/img-loader.js to a dynamic import() which is available in all CommonJS modules.
Instead change the require of index.js in /home/user/workspace/my-app/node_modules/@aceforth/nuxt-optimized-images/lib/loaders/img-loader.js to a dynamic import() which is available in all CommonJS modules.
at requireImageminPlugin (/home/user/workspace/my-app/node_modules/@aceforth/nuxt-optimized-images/lib/loaders/img-loader.js:20:10)
at getImgLoaderOptions (/home/user/workspace/my-app/node_modules/@aceforth/nuxt-optimized-images/lib/loaders/img-loader.js:49:11)
at applyImgLoader (/home/user/workspace/my-app/node_modules/@aceforth/nuxt-optimized-images/lib/loaders/img-loader.js:93:28)
at appendLoaders (/home/user/workspace/my-app/node_modules/@aceforth/nuxt-optimized-images/lib/loaders/index.js:134:14)
at WebpackBundler.<anonymous> (/home/user/workspace/my-app/node_modules/@aceforth/nuxt-optimized-images/lib/index.js:62:16)
at next (/home/user/workspace/my-app/node_modules/@nuxt/utils/dist/utils.js:659:27)
at WebpackBundler.<anonymous> (/home/user/workspace/my-app/node_modules/@nuxt/utils/dist/utils.js:674:12)
at WebpackClientConfig.extendConfig (/home/user/workspace/my-app/node_modules/@nuxt/webpack/dist/webpack.js:1509:37)
at WebpackClientConfig.config (/home/user/workspace/my-app/node_modules/@nuxt/webpack/dist/webpack.js:1544:50)
at WebpackClientConfig.config (/home/user/workspace/my-app/node_modules/@nuxt/webpack/dist/webpack.js:1708:26)
at WebpackBundler.getWebpackConfig (/home/user/workspace/my-app/node_modules/@nuxt/webpack/dist/webpack.js:2016:19)
at WebpackBundler.build (/home/user/workspace/my-app/node_modules/@nuxt/webpack/dist/webpack.js:2023:12)
at Builder.build (/home/user/workspace/my-app/node_modules/@nuxt/builder/dist/builder.js:327:30)
at async Object._buildDev (/home/user/workspace/my-app/node_modules/@nuxt/cli/dist/cli-dev.js:107:5)
at async Object.startDev (/home/user/workspace/my-app/node_modules/@nuxt/cli/dist/cli-dev.js:65:7)
at async Object.run (/home/user/workspace/my-app/node_modules/@nuxt/cli/dist/cli-dev.js:52:5)
at async NuxtCommand.run (/home/user/workspace/my-app/node_modules/@nuxt/cli/dist/cli-index.js:413:7)
I’m using Nuxt 2.15.7, together with Typescript.
What am I doing wrong?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
require() of ES Module (.\node_modules\imagemin-svgo\index ...
Hi, I am getting wired error while trying to use next-optimised-images for nextjs12.x and node16.13.0 require() of ES Module (.
Read more >Error [ERR_REQUIRE_ESM]: require() of ES Module ... not ...
The current version of node-fetch is ONLY compatible with an ESM import (using import ), not from CommonJS modules using require() .
Read more >imagemin-svgo - npm
SVGO imagemin plugin. Latest version: 10.0.1, last published: a year ago. Start using imagemin-svgo in your project by running `npm i ...
Read more >gulp Error [ERR_REQUIRE_ESM]: require() of ES Module not ...
The gulp error "[ERR_REQUIRE_ESM]: require() of ES Module not supported" occurs because the gulp-imagemin package has been converted to be an ESM only ......
Read more >gulp-imagemin - Bountysource
Currently imagemin-svgo is limited to 7.x releases. ... stuck into this error when npm install: ... require() of ES modules is not supported....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would like to make a PR to update this. My own project is dependent on this, and we are in the process of updating our dependencies.
@Torgian did you manage to do it?