Safari extension fails with any error message

I migrated my extension from Manifest V2 to V3 recently, and it works fine on Chrome/Edge, but got failed on Safari. The only error message that I can see is:

由于出现错误,service_worker脚本载入失败。

It says service_worker failed to load. There is no other messages I can found.

Can you please tell me how to get more informations about the error? Thanks!

This indicates your service worker is throwing an exception, like using an API that Safari does not support. At this time there is no way to see that exception to debug it.

You can try making the background script use the scripts array instead of service_worker, which is still supported in v3 in Safari. That way you can debug any errors in the Develop menu.

It's a bug in v15.x(include 15.4~15.6), it was fixed in >= v16.4 https://webkit.org/blog/13966/webkit-features-in-safari-16-4/#safari-web-extensions

Fixed background service worker failing to import scripts.

Safari extension fails with any error message
 
 
Q