question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manifest V3 Service worker registration failed

See original GitHub issue

Type:

  • [x ] bug
  • feature
  • enhancement
  • question

Environment:

  • OS:
  • Browser: Chrome
  • Library Version:

I’m going to open a PR:

  • yes
  • [ x] no

Description: Getting error: “Service worker registration failed” , "background": { "service_worker": "background.js" }, is highlighted in the error. When I build for production, the error goes away. I think it has to do with all of the code that this library adds to the background.js file when it is output.

This is from my config file:

      // Chrome extension hot reloading.
      isEnvDevelopment &&
        new ChromeExtensionReloader({
          reloadPage: true, // Force the reload of the page also
          entries: {
            // The entries used for the content/background scripts
            background: "background",
            contentScript: "content-script", // Use the entry names, not the file name or the path
          },
        }),
    ].filter(Boolean),

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:8
  • Comments:16

github_iconTop GitHub Comments

3reactions
designcodecommented, May 26, 2021

I am experiencing same issue. It’s because it injects the “webpack-extension-reloader” code in compiled background.js. That prevents the service worker from working.

1reaction
sambesseycommented, Feb 2, 2022

Thanks makes sense!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service worker registration failed. Chrome extension
If the worker script throws an error at installation, the worker won't be registered and you will not be getting the error information...
Read more >
Manifest V3 service worker registration failed - Google Groups
I'm trying to convert an extension to Manifest V3 and begun by making the necessary changes to the manifest.json file and creating a...
Read more >
Known issues when migrating to Manifest V3
This page lists major known issues that affect developers as they migrate to Manifest V3. Known issues are divided into two primary groups:....
Read more >
Service worker registration failed. Cannot read property ...
... advisable to wrap the background.js via a wrapper so you'll get better error message, so if there's no action property in manifest.json....
Read more >
Chrome Extension Tutorial: Migrating to Manifest V3 from V2
Manifest V3 replaces background scripts with service workers. ... and when you click it, it will say "service worker registration failed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found