-
Notifications
You must be signed in to change notification settings - Fork 30k
Labels
SWCRelated to minification/transpilation in Next.js.Related to minification/transpilation in Next.js.
Description
Link to the code that reproduces this issue
https://github.com/franknoel/next-workspace-swc-issue
To Reproduce
- Clone the repo and install the workspace dependencies using
pnpm i - Navigate to the Next.js app using
cd packages/reproduction-app - Run
pnpm dev
Current vs. Expected behavior
The last command should run the dev server normally, but instead it crashes while trying to download SWC.
> next dev
Downloading swc package @next/swc-darwin-arm64... to /Users/X/Library/Caches/next-swc
npm warn Unknown env config "npm-globalconfig". This will stop working in the next major version of npm.
npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm.
npm warn Unknown env config "minimum-release-age". This will stop working in the next major version of npm.
npm error code ENOWORKSPACES
npm error This command does not support workspaces.
npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2025-12-04T20_44_00_899Z-debug-0.log
Unhandled Rejection: Error: Failed to get registry from "pnpm".
at ignore-listed frames {
[cause]: Error: Command failed: pnpm config get registry
npm warn Unknown env config "npm-globalconfig". This will stop working in the next major version of npm.
npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm.
npm warn Unknown env config "minimum-release-age". This will stop working in the next major version of npm.
npm error code ENOWORKSPACES
npm error This command does not support workspaces.
npm error A complete log of this run can be found in: /Users/X/.npm/_logs/2025-12-04T20_44_00_899Z-debug-0.log
at ignore-listed frames {
status: 1,
signal: null,
output: [
null,
<Buffer >,
<Buffer 6e 70 6d 20 77 61 72 6e 20 55 6e 6b 6e 6f 77 6e 20 65 6e 76 20 63 6f 6e 66 69 67 20 22 6e 70 6d 2d 67 6c 6f 62 61 6c 63 6f 6e 66 69 67 22 2e 20 54 68 ... 576 more bytes>
],
pid: 17033,
stdout: <Buffer >,
stderr: <Buffer 6e 70 6d 20 77 61 72 6e 20 55 6e 6b 6e 6f 77 6e 20 65 6e 76 20 63 6f 6e 66 69 67 20 22 6e 70 6d 2d 67 6c 6f 62 61 6c 63 6f 6e 66 69 67 22 2e 20 54 68 ... 576 more bytes>
}
}
After running pnpm dev again, it throws the following:
> next dev
⚠ Attempted to load /Users/X/next-workspace-swc-issue/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/next-swc-fallback/@next/swc-darwin-arm64/next-swc.darwin-arm64.node, but it was not installed
⚠ Attempted to load @next/swc-darwin-arm64, but it was not installed
⚠ Attempted to load @next/swc-wasm-nodejs, but it was not installed
⚠ Attempted to load @next/swc-wasm-web, but it was not installed
⨯ Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
⨯ Failed to load next.config.ts, see more info here https://nextjs.org/docs/messages/next-config-error
Error: Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
at ignore-listed frames
⚠ Attempted to load /Users/X/next-workspace-swc-issue/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/next-swc-fallback/@next/swc-darwin-arm64/next-swc.darwin-arm64.node, but it was not installed
⚠ Attempted to load @next/swc-darwin-arm64, but it was not installed
⚠ Attempted to load @next/swc-wasm-nodejs, but it was not installed
⚠ Attempted to load @next/swc-wasm-web, but it was not installed
⨯ Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
ELIFECYCLE Command failed with exit code 1.
Provide environment information
Running `npx --no-install next info` also crashes, here's the output:
Attempted to load /Users/X/next-workspace-swc-issue/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/next-swc-fallback/@next/swc-darwin-arm64/next-swc.darwin-arm64.node, but it was not installed
⚠ Attempted to load @next/swc-darwin-arm64, but it was not installed
⚠ Attempted to load @next/swc-wasm-nodejs, but it was not installed
⚠ Attempted to load @next/swc-wasm-web, but it was not installed
⨯ Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
Unhandled Rejection: Error: Failed to load SWC binary for darwin/arm64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
at ignore-listed frames
As a reference, here's my OS info from another issue I did from this machine:
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Mon Aug 11 21:16:21 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T6000
Available memory (MB): 32768
Available CPU cores: 10Which area(s) are affected? (Select all that apply)
SWC
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), Vercel (Deployed)
Additional context
I initially discovered this issue while trying to do the security update for CVE-2025-66478. It was somehow working fine before updating to v15.5.7 on my other project.
It is also crashing during Vercel deployment during the build step. Here's the error output:
@my-project:build: npm error code ENOWORKSPACES
@my-project:build: npm error This command does not support workspaces.
@my-project:build: npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-12-04T20_20_15_934Z-debug-0.log
@my-project:build: unhandledRejection [Error: Failed to get registry from "pnpm".] {
@my-project:build: [cause]: [Error: Command failed: pnpm config get registry
@my-project:build: npm error code ENOWORKSPACES
@my-project:build: npm error This command does not support workspaces.
@my-project:build: npm error A complete log of this run can be found in: /vercel/.npm/_logs/2025-12-04T20_20_15_934Z-debug-0.log
@my-project:build: ] {
@my-project:build: status: 1,
@my-project:build: signal: null,
@my-project:build: output: [
@my-project:build: null,
@my-project:build: <Buffer >,
@my-project:build: <Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 4e 4f 57 4f 52 4b 53 50 41 43 45 53 0a 6e 70 6d 20 65 72 72 6f 72 20 54 68 69 73 20 63 6f 6d 6d 61 6e ... 141 more bytes>
@my-project:build: ],
@my-project:build: pid: 270,
@my-project:build: stdout: <Buffer >,
@my-project:build: stderr: <Buffer 6e 70 6d 20 65 72 72 6f 72 20 63 6f 64 65 20 45 4e 4f 57 4f 52 4b 53 50 41 43 45 53 0a 6e 70 6d 20 65 72 72 6f 72 20 54 68 69 73 20 63 6f 6d 6d 61 6e ... 141 more bytes>
@my-project:build: }
@my-project:build: }
@my-project:build: ELIFECYCLE Command failed with exit code 1.
@my-project:build: ERROR: command finished with error: command (/vercel/path0/packages/my-project) /vercel/.local/share/pnpm/.tools/pnpm/10.24.0/bin/pnpm run build exited (1)
@my-project#build: command (/vercel/path0/packages/my-project) /vercel/.local/share/pnpm/.tools/pnpm/10.24.0/bin/pnpm run build exited (1)
mvantellingen
Metadata
Metadata
Assignees
Labels
SWCRelated to minification/transpilation in Next.js.Related to minification/transpilation in Next.js.