Open raphaelsaunier opened 8 months ago
I'm having the same error, on Windows 11, with Next.js 14.
Yup, I just upgraded to Bun v1.1.27 and I can confirm that the issue still persists.
In the example below, it occurs after upgrading from Next 14.2.3 to 14.2.9:
$ bun i
[0.07ms] ".env"
bun install v1.1.27 (267afa29)
+ next@14.2.9
5 packages installed [3.70s]
$ bun run dev
▲ Next.js 14.2.9
- Local: http://localhost:3000
- Environments: .env.development, .env
- Experiments (use with caution):
· instrumentationHook
✓ Starting...
⚠ Mismatching @next/swc version, detected: 14.2.3 while Next.js is on 14.2.9. Please ensure these match
[…]
⨯ ./src/instrumentation.ts
Error: unknown field `hashSalt`, expected `isReactServerLayer` or `enabled` at line 1 column 1109
Error: An error occurred while loading instrumentation hook: Cannot find module '/path/to/project/.next/server/instrumentation'
Require stack:
- /path/to/project/node_modules/next/dist/server/dev/next-dev-server.js
- /path/to/project/node_modules/next/dist/server/next.js
- /path/to/project/node_modules/next/dist/server/lib/start-server.js
What version of Bun is running?
1.0.25+a8ff7be64
What platform is your computer?
Darwin 23.3.0 x86_64 i386
What steps can reproduce the bug?
npx create-next-app@latest
next
version (e.g. from14.0
->14.1
, or from14.1
to14.1.1-canary.36
) in package.jsonbun install
What is the expected behavior?
Next.js and its
@next/swc_{platform}
optional (peer?) dependency should both be updated to the specified version.What do you see instead?
Next.js is correctly updated but
@next/swc
isn't and triggers a warning when runningbun run dev
orbun run build
.Additional information
Workaround:
yarn install
once to fetch/link the correct package and the warning disappears.Also, running
bun pm cache rm
does not solve the issue.