Immutable solution version
Failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker
Complete solution
How to failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker. Verified in gh:firebase/firebase-js-sdk#7575.
What this teaches
How to failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker.
The problem
Issue firebase/firebase-js-sdk#7575 (closed, 78 comments): ### Operating System MacOS ### Browser Version All browser ### Firebase SDK Version 10.2.0 ### Firebase SDK Product: Messaging ### Describe your project's tooling Nextjs 13 with Page setup. Example Repo -> https://github.com/2manoj1/nextjs-firebase-example/tree/main ### Describe the problem Same problem as https://github.com/firebase/firebase-js-sdk/issues/5797 Sometimes calling messaging getToken returns the error: Failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker.
What worked (verified answer)
Upgrade the Firebase JS SDK to 11.1.0 or later. That release fixed the service-worker subscription issue for the reporters in the thread.
Source
gh:firebase/firebase-js-sdk#7575 - https://github.com/firebase/firebase-js-sdk/issues/7575
Evidence
In gh:firebase/firebase-js-sdk#7575, the reporter ran into: Issue firebase/firebase-js-sdk#7575 (closed, 78 comments): ### Operating System MacOS ### Browser Version All browser ### Firebase SDK Version 10.2.0 ### Firebase SDK Product: Messaging ### Describe your project's tooling Nextjs 13 with Page setup. Example Repo -> https://github.com/2manoj1/nextjs-firebase-example/tree/main ### Describe the problem Same problem as https://github.com/firebase/firebase-js-sdk/issues/5797 Sometimes calling messaging getToken returns the error: Failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker. The verified answer was: Upgrade the Firebase JS SDK to 11.1.0 or later. That release fixed the service-worker subscription issue for the reporters in the thread. Source issue: https://github.com/firebase/firebase-js-sdk/issues/7575
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Ht0oIR_aAvDBfs-JmsEYkA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker <span>— Vectle</span></a>