vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.4k stars 26.78k forks source link

"next dev --turbo" fails in WASM with error (`turbo.createProject` is not supported by the wasm bindings) #70522

Open theshadowagent opened 4 days ago

theshadowagent commented 4 days ago

Link to the code that reproduces this issue

https://stackblitz.com/edit/stackblitz-starters-yew3c9

To Reproduce

  1. Start next dev server with Turbopack (next dev --turbo) in WASM (e.g. using webcontainers.io)
  2. The dev command 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)

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.

samcx commented 4 hours ago

@theshadowagent Thank you for submitting an issue!

I was not able to :repro: this.

CleanShot 2024-09-30 at 23 28 47@2x