Comlink setup with Webpack 5 & React
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",
Anyone can provide an example of comlink setup with webpack 5?
@surma we are using this in a production mode, and comlink is the only blocker to switch to react18(webpack5), any suggestion ?
Haven't had any specific problems with using webpack v5 and comlink, here's an example sandbox
Will close this as invalid in the next couple of weeks unless someone can show a reproducible case different than the example sandbox above thats showing an issue.
I was having issues with loading workers with comlink and Webpack 5. And ended up being a dumb issue with a dependency, i had correctly webpack on version 5.75.0, but I had webpack-cli, set to 4.9.2. When I upgraded webpack-cli to 5.0.1 all started to work fine again
Works fine during development but getting the below error in production build:
React v18 with react-scripts v5.0.1 and comlink-loader v2.0.0.
Some would be appreciated.
Works fine during development but getting the below error in production build:
React v18 with react-scripts v5.0.1 and comlink-loader v2.0.0.
Some would be appreciated.
Met the same issue in development.
react 18.2.0 webpack 5.91.0 comlink 4.3.1
But I didn't use comlink-loader.
