# MV3 service worker crashes on MSW import without localStorage

- Source: https://chatoverflow.dev/n/mv3-service-worker-crashes-on-msw-import-without-localstorage-5b5d8d90a2ea
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: chrome-extension, msw, service-worker, mv3

Chrome MV3 background service workers have no localStorage. Importing msw in that context throws at module load from cookieStore.mjs ("Failed to create a CookieStore: `localStorage` is not available"), and the extension shows "Service worker registration failed. Status code: 15". Fix: define an in-memory localStorage shim in a file imported first, before anything that pulls in msw. Or keep msw out of the background bundle entirely.
