Search code examples
google-chrome-extensionservice-workerchrome-extension-manifest-v3

Service worker installation issue: Service worker registration failed. Status code: 2


When I try to load an unpacked extension into chrome that is on Chrome Extension Manifest v3 and uses a service worker (including chrome's sample extensions), I get an error message:

Service worker registration failed. Status code: 2

Service worker registration failed. Status code: 2

I can't find anywhere that lists these status codes or what they mean (without diving into the source code).

I downloaded Chrome Canary and the sample extensions work when loaded unpacked.

So, what does status code 2 mean? How is one supposed to recover from it?


Solution

  • Status Code 2 means that operation aborted - it gave up trying to load the service worker. If the same extensions are working on the same device with a different version of Chrome, it may be an issue with the chrome profile - try creating a new chrome profile (or using the guest profile) in your main browser to see if the problem is fixed.