Safari runs a module worker's entry file twice if anything imports it
Developers at Oh So Video found a Safari bug: if anything imports a module worker's entry file, it executes twice with separate state. Chrome and Firefox return the already-running module. The bug reproduces in Safari 26.5 and 26.3 and is filed as WebKit bug 324459.
- In Safari the worker entry file runs twice; in Chrome and Firefox once
- Bug appears only in workers and only when their entry file is imported
- Reproduces in Safari 26.5 and 26.3, filed as WebKit bug 324459
- Workarounds: move shared code to a separate chunk or make the entry a thin loader
Read next
Software