You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrading wasm-pack to the latest version (0.13.0) results in the following error with bundlers:
Module not found: Error: Can't resolve '../../..' in '/home/runner/work/solana-playground/solana-playground/client/node_modules/@solana-playground/rust-analyzer/snippets/wasm-bindgen-rayon-7afa899f36665473/src'
Did you mean 'rust_analyzer_wasm.js'?
BREAKING CHANGE: The request '../../..' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
The structure of the wasm-bindgen generated package didn't change, but rustwasm/wasm-pack#1061 added type: "module" to the package.json which expects full path imports.
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: