SharedWorker not working due to query string added to file #9928
Unanswered
krpatter-intc
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a shared worker created like so:
this.worker = new SharedWorker(new URL("worker.ts", import.meta.url), {type: "module"})
However, when parcel fetches the
.ts
file it adds a query string ?1724708901069 (a timestamp looking number, example: worker.ts?1724708901069) (that I can't figure out how to get rid of). This breaks the SharedWorker as the browser considers it a different worker -- and a new one gets created. Thenew URL
HAS to be created in the same line as the shared worker due to the issue referenced below (and in some other related issues I saw).The docs explicitly mention that SharedWorker is supported, but there's no recipe given...anyone out there know how to work around / fix this?
Related issue:
import.meta.resolve(…)
#8924Beta Was this translation helpful? Give feedback.
All reactions