Web worker not starting up in production build #18932
-
I have a vue SPA that works well in debug mode (running vite cmd in project dir). But when I compile in production mode and run it the main app runs but a web worker won't start up. The build ...
I have a debug print before the postMessage call to the worker which shows the call is made. A debug print at the beginning of the worker code doesn't appear. The worker never starts. In the debug run the worker starts and functions. Creating the worker object gives no error. I assume it is finding the source file. In my experience it throws a Module Not Found if not. I printed out the worker object in the main app after the onError and onMessage calls were attached and it looks normal in both debug and production runs. BTW, how does the production code find the worker.js file? I don't see that file in the assets. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
How are you creating your worker? Have you followed the docs? |
Beta Was this translation helpful? Give feedback.
Please try following the docs I linked & using the URL constructor instead of a string path.