next.js: "next dev --turbo" fails in WASM with error (`turbo.createProject` is not supported by the wasm bindings)
Link to the code that reproduces this issue
https://stackblitz.com/edit/stackblitz-starters-yew3c9
To Reproduce
- Start
nextdev server with Turbopack (next dev --turbo) in WASM (e.g. using webcontainers.io) - The
devcommand fails with error
~/projects/stackblitz-starters-yew3c9
❯ npm install
added 10 packages, and changed 6 packages in 34s
144 packages are looking for funding
run `npm fund` for details
~/projects/stackblitz-starters-yew3c9 34s
❯ npx next dev --turbo
▲ Next.js 15.0.0-canary.171 (turbo)
- Local: http://localhost:3000
✓ Starting...
Downloading swc package @next/swc-wasm-nodejs... to /home/.cache/next-swc
Error: `turbo.createProject` is not supported by the wasm bindings.
at Object.createProject (/home/projects/stackblitz-starters-yew3c9/node_modules/next/dist/build/swc/index.js:808:31)
at createHotReloaderTurbopack (/home/projects/stackblitz-starters-yew3c9/node_modules/next/dist/server/dev/hot-reloader-turbopack.js:121:42)
at async startWatcher (/home/projects/stackblitz-starters-yew3c9/node_modules/next/dist/server/lib/router-utils/setup-dev-bundler.js:164:38)
at async setupDevBundler (/home/projects/stackblitz-starters-yew3c9/node_modules/next/dist/server/lib/router-utils/setup-dev-bundler.js:814:20)
at async Span.traceAsyncFn (/home/projects/stackblitz-starters-yew3c9/node_modules/next/dist/trace/trace.js:157:20)
at async initialize (/home/projects/stackblitz-starters-yew3c9/node_modules/next/dist/server/lib/router-server.js:87:30)
at async Server.eval (/home/projects/stackblitz-starters-yew3c9/node_modules/next/dist/server/lib/start-server.js:266:36)
Current vs. Expected behavior
I expected next dev --turbo to work in WASM mode so I could have fast hot reloading, but it throws this error
Provide environment information
❯ npx next info
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS
Available memory (MB): NaN
Available CPU cores: 8
Binaries:
Node: 18.20.3
npm: 10.2.3
Yarn: 1.22.19
pnpm: 8.15.6
Relevant Packages:
next: 15.0.0-canary.171 // Latest available version is detected (15.0.0-canary.171).
eslint-config-next: 13.5.1
react: 18.2.0
react-dom: 18.2.0
typescript: 5.2.2
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I tested my reproduction against “15.0.0-canary.171” (latest canary release), and “14.2.13” (latest stable release). On stable it outputs a different error: TypeError: bindings.turbo.createProject is not a function.
I found the code that throws this: https://github.com/vercel/next.js/blob/3ed9f4b3f4d1f8b431ff04d4e6a45a949680a31f/packages/next/src/build/swc/index.ts#L1063
Is wasm bindings support planned for turbopack anytime soon? Was very bummed to see this, since it considerably slows down next.js in browser IDEs.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (4 by maintainers)
Bumping this, except for me rather than not working on stackblitz it doesn’t work on my FreeBSD laptop
I had the same issue, and this worked for me: 🚀 1️⃣ Delete the .next and node_modules folders 🗑️ 2️⃣ Run npm install (or yarn install) 📦 3️⃣ Restart the development server 🔄
Hope this helps! ✨
i ran into this error too i guess it happened because while creating the nextjs app some packages are not installed correctly what i did is delete the project and create it from the start and the error no longer exists
solution: delete the nextjs project you just created and create a new one from the start by using the command npx create-next-app@latest
@samcx @abhi12299 Here’s an update on how to reproduce:
next devwithout--turboflag by default (specifically, it runsnpm install && npx next dev)npm install && npm run devwhich runs thenext dev --turbocommand and failsApologies for confusing you here – I couldn’t find a way to change the default run command in Stackblitz
Thanks for the swift response!