Replies: 5 comments 40 replies
|
Hey guys there seems to be an issue in my situation. So I have a project which I bundle for use in a React project. When I try to use It compiles fine with just the compiled js contents of the typescript worker file. However neither work and they both cause an Both React App and project use webpack 5. The project webpack config: |
|
I think HMR will conflict with this. then I will get But in fact Promise can be used in web worker with modern browsers and I have tested that the async can use in my browser. |
|
I have spent more tha a day trying to make this work with electron, typescript, commonjs (no import.meta.url) and webpack 5 way. Been through so many hacks suggested by copilot and my own humble intelligence:-), but none really worked! |



Uh oh!
There was an error while loading. Please reload this page.
Hi,
The documentation for webpack 5 says that webpack no longer needs
worker-loaderto load web worker files.This is reinforced by the README on the
worker-loaderpage, which warns thatworker-loaderis only intended for use with webpack 4 and is not supposed to be used with webpack 5.However, the example of worker usage in the webpack docs is very simple — it assumes that developers author their worker files in javascript. How should one configure webpack to be able to load workers authored in typescript?
All reactions