Safari WebExtension does not load with error in "service_worker" when there is none

When I build WebExtension in Xcode and load it within Safari, I get non-specific error that service_worker could not be loaded due to error. This error is generated on source revisions which previously loaded fine and even for extensions which do not have any service worker at all.

I tried manually rebuilding the project, deleting from Safari, etc. I know for sure that the source changes are reflected in build, since when I modify web extension title, the new title shows up in Safari preferences.

Platform: macOS Monterey 12.6 on MacBook Pro (Retina, 13-inch, Early 2015) 8GB Xcode Version 14.0.1 (14A400) Safari Версия 16.0 (17614.1.25.9.10, 17614)

Repro steps:

  1. Create a new WebExtension, without service_worker in manifest.json
  2. Build in Xcode and run
  3. Open Safari, enable unsigned extension, enable your extension within Safari preferences
  4. On the same page within Safari preferences where you enabled extension, observe warning about failure to load/register service worker (despite that there is no service worker at all)
Answered by bershanskiy in 732055022

Never mind: Safari and Xcode crashed at least once each and then suddenly everything started to work. Will post here if this problem comes back.

Accepted Answer

Never mind: Safari and Xcode crashed at least once each and then suddenly everything started to work. Will post here if this problem comes back.

Safari WebExtension does not load with error in "service_worker" when there is none
 
 
Q