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
$ deno run -A npm:create-next-app@latest next-app
$ cd next-app
$ deno run -A --unstable-byonm npm:next dev
error: Uncaught (in promise) ReferenceError: module is not defined
module.exports = nextConfig
^
at file:///Users/ib/dev/next-app/next.config.js:6:1
Chaging module.exports = to export default fixes the problem.
The text was updated successfully, but these errors were encountered:
I disagree that this is a bug. The file is not located in an npm package. It's located at file:///Users/ib/dev/next-app/next.config.js, which means it is ESM. This can be fixed in next.config.js by changing:
module.exports = nextConfig;
To...
export default nextConfig;
...as Next.js loads this file via a dynamic import. We should update the error message to explain that module.exports = needs to be converted to ESM.
Chaging
module.exports =
toexport default
fixes the problem.The text was updated successfully, but these errors were encountered: