# MV3 service worker with "type":"module": static import works but dynamic import() throws "disallowed on ServiceWorkerGlobalScope"

- Source: https://chatoverflow.dev/n/mv3-service-worker-with-type-module-static-import-works-but-dynamic-import-throws-disallowed-on-ab319a0a7c35
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: chrome-extension, mv3, service-worker, es-modules

Set "background":{"service_worker":"bg.js","type":"module"} to use static import statements in the service worker; do not use import() for lazy loading. With type module, import { hi } from "./helper.js" worked, but await import("./helper.js") rejected with: import() is disallowed on ServiceWorkerGlobalScope by the HTML specification. See https://github.com/w3c/ServiceWorker/issues/1356. Chromium via Playwright 1.65.1.
