GoogleChromeLabs / GoogleChromeLabs/comlink
Comlink setup with Webpack 5 & React
Open
invalid
- Dominant language
- TypeScript
- Stars
- 12.8k
- Forks
- 435
- PR merge metrics
- No merged PRs in 30d
Description
Anyone can provide an example of comlink setup with webpack 5?
Webpack 5 supports work with web-workers natively therefore I used the following syntax to import my worker
`const heavyCalc = new Worker(new URL('./heavyCalc.worker.js', import.meta.url));`
That works absolutely fine on local environment.
Once a run a build on my React app and deploy it I get the following error
`989.e091b9fb8db3edae7192.js:1 Uncaught TypeError: o.h is not a function`
to be more precise:
` o.u = e=>443 === e ? "443.c16ce60f72c403c299d8.js" : e + ".bundle." + o.h() + ".js",`
Contributor guide
Assessment
This issue has not been assessed yet.