Open mattijauhiainen opened 5 months ago
Can you try changing the worker file to a normal javascript (.js instead of .ts) and see if that works?
Can you try changing the worker file to a normal javascript (.js instead of .ts) and see if that works?
Doesn't seem to help, getting the same error. Tried this https://github.com/mattijauhiainen/WebWorkerRepro/commit/7f663941779ce4d07ab8cda48ee14be1eeb9abba and this https://github.com/mattijauhiainen/WebWorkerRepro/commit/eeb7e3880686ed299b9373fd0f1c3e01f8358ec7
Describe the bug
When I try to import a webworker in prod build, the worker script fails to parse. It looks like the server is responding with HTML, not the javascript file, and I see error "SyntaxError: Unexpected token '<'" in the dev tools console.
In dev build everything works as expected. Is there a bug here, or am I importing the worker incorrectly?
Reproduction
Link to minimal tauri app for reproduction: https://github.com/mattijauhiainen/WebWorkerRepro/commit/2f14494d429f969d5ae0389cc30a68b3f06d3bd1
To reproduce
npm run tauri build
Reproduces on Mac OS, have not tested on other platforms.
Expected behavior
Expected behaviour is the worker script to parse and execute the log statement.
Full
tauri info
output