-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Incompatibility with wasm-pack 0.13.0
#9
Comments
`wasm-bindgen-rayon` is not compatible with `wasm-pack 0.13.0`, see RReverser/wasm-bindgen-rayon#9
Here's another solution using the latest version of wasm-pack, if you're having the same problem, it might help. Just set resolvefullyspecified to false in your webpack config This is how I'm applying it in my project https://github.com/noname0310/babylon-mmd/blob/main/webpack.config.ts#L70-L73 export default (env: any): webpack.Configuration & { devServer?: WebpackDevServerConfiguration } => ({
// ...
module: {
rules: [
{
test: /\.m?js$/,
resolve: {
fullySpecified: false
}
},
]
},
// ...
}); |
Hm yeah I don't think there's much we can do here on the wasm-bindgen-rayon side. Changing webpack configuration sounds like the right approach for now, but otherwise this will require changes from either wasm-bindgen or wasm-pack side. |
Problem
Upgrading
wasm-pack
to the latest version (0.13.0
) results in the following error with bundlers:wasm-bindgen-rayon/src/workerHelpers.worker.js
Lines 18 to 22 in a947bdc
The structure of the
wasm-bindgen
generated package didn't change, but rustwasm/wasm-pack#1061 addedtype: "module"
to thepackage.json
which expects full path imports.Related upstream issue: rustwasm/wasm-pack#1402
Solution
This should probably get fixed from
wasm-pack
's side by introducing an option forwasm-pack build
that changes thetype
used.In the meantime, there are 2 possible immediate workarounds for people who run into this:
type: "module"
from the generatedpackage.json
wasm-pack 0.12.1
The text was updated successfully, but these errors were encountered: