Cannot launch nextjs test project
Opened this issue · 0 comments
tusharsnx commented
There is a bad file name issue in our nextjs test project. The project is not an ESM module, yet the nextjs config file that uses .js
extension uses ESM import syntax.
Error message:
(node:159927) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
/home/tushar/projects/jsx-css-module-transforms/test-projects/nextjs/next.config.js:1
import JsxCssModuleTransforms from "jsx-css-module-transforms";
^^^^^^
SyntaxError: Cannot use import statement outside a module
A possible fix is to replace the config's extension to be .mjs
and also update the export statement to follow ESM syntax