Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I've searched accross the web but except for webpack I can't seem to find any solution for an usage with Vite and:
Every attempts to load a worker from the rendered process vue file fails.
The last attempt looks as follows:
App.vue:
const worker = new Worker(new URL('./workers/worker?modulePath', import.meta.url)); worker.postMessage('message from main thread'); worker.onmessage = (ev: MessageEvent) => { console.log('do-something-in-renderer-thread', 'I received as a response from the worker', ev.data); };
src/workers/worker.ts
self.onmessage = (e: MessageEvent<string>) => { self.postMessage('response from worker for a message ' + e.data + ' :' + new Date().toISOString()); };
But if fails indicating that it tried to load an url that is in fact the rendered vue html app (probably taking the 404 not found behaviour of the app).
It's like it did not build any web worker file so it takes the app default page instead.
If any one has an idea on how to setup things for that it'd be very appreciated.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions