Closed litcodeur closed 4 months ago
I think, this might be a bug. When named my worker file foo.worker.ts
, it failed with the above error message, but when I renamed it to fooworker.ts
(without a dot separator) it worked as expected.
Please provide Code for a reproduction. And what Browser etc. you use.
Does this only happen in dev Mode or also production?
Also this might be an upstream issue in vite.
Here's a codesandbox with a minimal reproduction: https://codesandbox.io/p/devbox/charming-albattani-ktmypy
I'm using Arc browser (chromium based), on Mac device (M series).
Haven't built and pushed changes to verify, but can confirm happens in dev mode.
Workaround:
new URL("./worker.fail.ts", import.meta.url)
include extension in url.
I'm currently evaluating if this is a problem with this plugin or upstream in vite.
fixed with v5.0.0
Thanks!
When I'm trying to use this plugin to work with webworkers, I'm getting the following error message in my browser console.
And when I look into the path that it tries to fetch manually by opening it in a new tab, it returns a not found but the type of content returned by server is of html.
Lmk if there's more info I can provide to help out with the issue, Thanks!