1

I'm developing a scratch new chrome extension (one having only a service worker, using manifest version 3). Much of the time when I have its service worker crash due to my latest code addition, I find myself unable to get to a log / console view showing the crash reason. All I get is a dead link:

service worker (Inactive)

The hyperlink does not open the usual inspect view for the dead service worker. Alternatively, when I click the "Errors" button shown in the extensions view:

enter image description here

I just get "Service worker registration failed", but not any information about which line of code is causing the failure. Eventually I always find the error in my code by analytic means, but this really slows down my development iterations considerably. Is there a finer-grain view for this?

Manually opening the inspect view, there is nothing about the error to be found through the Console Nor the Application tabs of the inspect view.

Indeed after ticking the following option and reloading my extension ―

enter image description here

I do get a mention of my extension in this particular view ― after reloading my offending chrome extension ― but the details are less than revealing, as shown below:

enter image description here

It seems that wrapping the entire service worker code with a try catch surfaces the error details in some cases but not all.

Related Chrome issue: https://bugs.chromium.org/p/chromium/issues/detail?id=1152202

Community
  • 1
  • 1
matanster
  • 15,072
  • 19
  • 88
  • 167
  • The suggested answer adjoins manifest migration angles with this issue in a confusing way which could have merited a clean answer here, but okay leave it closed. Also sadly the suggested try catch solution does not always work. – matanster Aug 01 '21 at 02:24
  • 1
    The real solution is upgrading to Chrome 93, which at the time of writing is available on the official [Chrome Beta channel](https://www.google.com/chrome/beta/thank-you.html?platform=linux&statcb=0&installdataindex=empty&defaultbrowser=0) – matanster Aug 01 '21 at 02:54

0 Answers0