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

Cannot process WASM in a WebWorker #27

Open
twop opened this issue Oct 17, 2019 · 0 comments
Open

Cannot process WASM in a WebWorker #27

twop opened this issue Oct 17, 2019 · 0 comments

Comments

@twop
Copy link

twop commented Oct 17, 2019

This snippet doesn't work in a web worker but works fine in main.ts

// worker.ts
import module from "../crate/Cargo.toml";
module.run();

It seems that the issue is that it produces RawAsset for rust_parcel_bg.wasm which doesn't have generated

And it fails in JSPackager.js

 dedupeKey(asset) {
    // cannot rely *only* on generated JS for deduplication because paths like
    // `../` can cause 2 identical JS files to behave differently depending on
    // where they are located on the filesystem
    let deps = Array.from(asset.depAssets.values(), dep => dep.name).sort();
    return objectHash([asset.generated.js, deps]); // <------here
  }
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

No branches or pull requests

1 participant