Niels-IO / next-image-export-optimizer

Use Next.js advanced <Image/> component with the static export functionality. Optimizes all static images in an additional step after the Next.js static export.
MIT License
439 stars 52 forks source link

module is not defined in ES module scope #139

Closed chaveamin closed 1 year ago

chaveamin commented 1 year ago

This error occurs when running dev server: module is not defined in ES module scope img

Niels-IO commented 1 year ago

Hi @chaveamin, change the filename next.config.mjs to next.config.js.

chaveamin commented 1 year ago

I did it before(with .js and .cjs) but it shows the same error with .js: 1 with .cjs 2 and no result with adding "type": "module" in packege.json file

Niels-IO commented 1 year ago

I am quite sure this is not an issue with next-image-export-optimizer. Try to comment out on a first try the imports in your next.config.js and if the error persists, everything that comes from next-image-export-optimizer.

chaveamin commented 1 year ago

Problem solved by deleting the library completely and reinstalling it again, Thanks