developit/workerize-loader

Trouble loading WASM modules in worker (with possible solution)

wellcaffeinated opened this issue · 3 comments

I believe this loader suffers from the same issue as worker-loader
webpack/webpack#7647

When using a wasm-pack compiled module i get the error message:

TypeError: Cannot read property '.wasm' of undefined

referring to __webpack_require__.w

That worker-loader issue also has a pull request referencing it which does fix my problem... but I'd love to use workerize if possible.

Any chance of getting this fix into workerize-loader pretty please? :)

I tried it in a fork and it works.
Created pull request

Any update on merging this PR, devs?

I have a situation that I think this would fix. I'm doing some heavy statistical calculations on the front-end, and need them to be on a separate thread. I'm using the ttest package, which uses the distributions package, which uses the cephes package, which is written in webassembly. I'm getting a pretty nondescript compile/webpack error, but it does mention cephes, so based on this issue, I'm guessing the webassembly itself is the problem.

Great, thank you so much! Any chance of getting a new published release out with the recently merged PRs? ;)