You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
onmessage=function(e){console.log('Worker: Message received from main script');constresult: number=e.data[0]*e.data[1];if(isNaN(result)){postMessage('Please write two numbers');}else{constworkerResult=`Result: ${result}`;console.log('Worker: Posting message back to main script');postMessage(workerResult);}};
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
I just spent a few hours digging into why my web-test-runner tests started to fail, and I think it's due to exactly this issue. Starting in version 1.0.8 of @vitejs/plugin-react, the logic was changed from:
Describe the bug
fail to import script as a Worker, when using
@vitejs/plugin-react
id resolved with suffix like
/xxx/src/worker.ts?worker
can't apply parserPlugins of typescriptvite/packages/plugin-react/src/index.ts
Lines 205 to 207 in 4ffc9a5
Reproduction
Importing Script as a Worker
Use typescript in worker.ts
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: