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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

module is not defined in ES module scope

chaveamin opened this issue · comments

commented

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

commented

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

commented

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

commented

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.

commented

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