Skip to content

next.js can't process wasm compiled by recent rust versions (1.82+) #75807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ashi009 opened this issue Feb 8, 2025 · 2 comments · Fixed by #75847
Closed

next.js can't process wasm compiled by recent rust versions (1.82+) #75807

ashi009 opened this issue Feb 8, 2025 · 2 comments · Fixed by #75847
Labels
locked Webpack Related to Webpack with Next.js.

Comments

@ashi009
Copy link
Contributor

ashi009 commented Feb 8, 2025

Link to the code that reproduces this issue

https://github.com/ashi009/nextjs-wasm

To Reproduce

nvm use 22.11.0
npm i
npm run wasm
npm run dev
# open the dev link in browser 

Current vs. Expected behavior

Currently an error will be displayed

Module parse failed: Unknown element type in table: 0xNaN
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Error: Unknown element type in table: 0xNaN

It should print a greeting message instead.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:11 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 12
Binaries:
  Node: 22.11.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.1.6 // Latest available version is detected (15.1.6).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: N/A
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Webpack

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)

Additional context

This is because since rust 1.82.0, wasm is built with reference type enabled. Webpack v5.97.0 added the support to that, but next.js is still bundling webpack v5.96.1.

@github-actions github-actions bot added the Webpack Related to Webpack with Next.js. label Feb 8, 2025
@ashi009
Copy link
Contributor Author

ashi009 commented Feb 8, 2025

Duplication of #74265

Copy link
Contributor

github-actions bot commented Mar 4, 2025

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Mar 4, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Webpack Related to Webpack with Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants