Skip to content
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

[Bug]: Error while using "externals" with "asyncWebAssemly" #8647

Closed
sunflowerdeath opened this issue Dec 9, 2024 · 0 comments · Fixed by #8908
Closed

[Bug]: Error while using "externals" with "asyncWebAssemly" #8647

sunflowerdeath opened this issue Dec 9, 2024 · 0 comments · Fixed by #8908
Assignees
Labels
bug Something isn't working

Comments

@sunflowerdeath
Copy link

System Info

System:
OS: macOS 14.3
CPU: (8) arm64 Apple M1
Memory: 35.11 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 23.3.0 - ~/.nvm/versions/node/v23.3.0/bin/node
Yarn: 3.3.0 - ~/.nvm/versions/node/v23.3.0/bin/yarn
npm: 10.9.0 - ~/.nvm/versions/node/v23.3.0/bin/npm
pnpm: 7.16.1 - ~/.nvm/versions/node/v23.3.0/bin/pnpm
Browsers:
Chrome: 131.0.6778.109
Safari: 17.3

Details

Hello, I have encountered an error while building a project with Rspack.

I have reduced it down to the following configuration - workspace project that has two packages:

  • "a" is a main package, that imports library "b".
  • "b" is a library, which uses dependency marked as "external" and also requires asyncWebAssemly: true

I mage a repo that reproduces this bug.

Reproduce link

https://github.com/sunflowerdeath/rspack-wasm-externals-bug

Reproduce Steps

  1. Install deps: npm install
  2. Build library: cd b && npm run build
  3. Build main package: cd a && npm run build
  4. Go to http://localhost:8080 . You should see an error in console.

If you instead run npm run build-webpack in package a, you will not see an error in console and will see an output of the function.
Also if you run npm run serve which starts devServer, it also works correctly.

@sunflowerdeath sunflowerdeath added bug Something isn't working pending triage The issue/PR is currently untouched. labels Dec 9, 2024
@LingyuCoder LingyuCoder removed the pending triage The issue/PR is currently untouched. label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants