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

Update template to webpack 5 #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jtpio
Copy link

@jtpio jtpio commented Oct 17, 2020

Trying out the template with the recent webpack 5, it looks like the following change to the config is required to enable WebAssembly.

Thanks!

@olex-green
Copy link

olex-green commented Oct 24, 2020

I've tried to run with Webpack v5 with webpack-cli@4.1.0 and I got error: Error: Cannot find module 'webpack-cli/bin/config-yargs'

The solution: changing npm start script from:
"start": "rimraf dist pkg && webpack-dev-server --open -d",
to:
"start": "rimraf dist pkg && webpack serve"

@Swaagie
Copy link

Swaagie commented Nov 17, 2020

It seems that the webpack-dev-server is not fully compatible yet webpack/webpack-dev-server#2807. I can confirm that experiments needs to be added to webpack config. Using webpack@5 without the dev server works fine btw

@JohnForster
Copy link

Using webpack@5 without the dev server works fine btw

@Swaagie I can't seem to get this working, I get the error: "ReferenceError: Cannot access '__wbindgen_string_new' before initialization" unless I use experiments: { syncWebAssembly: true } in my webpack.config.js. Synchronous loading of wasm modules is deprecated since webpack v4.

Is there a way to configure wasm-pack so that we can use asyncWebAssembly instead?

@xtuc
Copy link
Member

xtuc commented Feb 5, 2021

@JohnForster this is likely an issue in the code that wasm-bindgen generates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants