Next 14: Specified module format (CommonJs) is not matching the module format of the source code (EcmaScript Modules) #2579
Replies: 9 comments 21 replies
-
Hm, I've never seen such an error message. Would you be able to create a reproduction with StackBlitz? |
Beta Was this translation helpful? Give feedback.
-
Same here! @dominik-sfl are you using turbo? |
Beta Was this translation helpful? Give feedback.
-
I got the same error using turbo. @dominik-sfl @danimrangelb Has anyone solved this issue? |
Beta Was this translation helpful? Give feedback.
-
We got the same error when upgrading from Kind of big project, but most of the dependencies are at the latest. Some notable deps:
Happy to answer any questions. |
Beta Was this translation helpful? Give feedback.
-
I made a draft PR to remove the type field in package.json, but we don't plan to merge it as of now: #2626 |
Beta Was this translation helpful? Give feedback.
-
I was able to edit out Doing this fixed it. |
Beta Was this translation helpful? Give feedback.
-
Just for anyone googling, just ran into this with next |
Beta Was this translation helpful? Give feedback.
-
Also ran into same issue spinning up a new Next.js 15.0.2 using Turbo in dev mode. |
Beta Was this translation helpful? Give feedback.
-
To fix this using pnpm: Prepare for patching: pnpm patch jotai Open package.json: open node_modules/.pnpm_patches/[email protected]/package.json Remove this line (L5): {
"name": "jotai",
"description": "👻 Primitive and flexible state management for React",
"private": false,
- "type": "commonjs",
"version": "2.10.1",
"main": "./index.js", Path this commit: pnpm patch-commit 'node_modules/.pnpm_patches/[email protected]' Now it should work though I don't know why. |
Beta Was this translation helpful? Give feedback.
-
In my newly installed next.js app (14.2.3), using
create-t3-app
, I get the following error when I import jotai's Provider & wrap it around its children:Simply by doing this:
TS Config (default t3 tsconfig)
Anyone know what's going on here? :/
Beta Was this translation helpful? Give feedback.
All reactions