coderef

JavaScript modules in workersBaseline · Widely available

The Worker() constructor accepts { type: "module" } to load scripts that use import and export. Also known as ECMAScript modules or ESM in workers.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jun 6, 2023. Widely available since Dec 6, 2025.

Browser support

DesktopChrome
1–79Not supported
80+Supportedsince Feb 4, 2020
Current: 155
Edge
12–79Not supported
80+Supportedsince Feb 7, 2020
Current: 154
Firefox
1–113Not supported
114+Supportedsince Jun 6, 2023
Current: 157
Safari
1–14.1Not supported
15+Supportedsince Sep 20, 2021
Current: 27
MobileChrome Android
18–79Not supported
80+Supportedsince Feb 4, 2020
Current: 155
Firefox Android
4–113Not supported
114+Supportedsince Jun 6, 2023
Current: 157
Safari iOS
1–14.5Not supported
15+Supportedsince Sep 20, 2021
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN — see the links below.

Feature detection

JS · check before using
if ("Worker" in globalThis && "Worker" in Worker.prototype) {
  // Worker.Worker is available
}

Sub-features

Support for each part of the feature (4). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Worker.Worker.ecmascript_modules8080114158011415
Worker.Worker.options_type_parameter8080114158011415
import.worker_support8080114158011415
import.worker_support8080114158011415