Skip to content

Firebase messaging service worker failed to load v10.12.5 script #8409

Closed
@yhuang1211

Description

@yhuang1211

Operating System

MacOS 14.5

Browser Version

Chrome 127.0.6533.89

Firebase SDK Version

10.12.5

Firebase SDK Product:

Messaging

Describe your project's tooling

NextJS App

Describe the problem

Chrome keeps logging the following error after updating to v10.12.5:

Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://www.gstatic.com/firebasejs/10.12.5/firebase-app-compat.js' failed to load.
at https://.../firebase-messaging-sw.js:1:1

Steps and code to reproduce issue

Update to firebase sdk 10.12.5 and modify firebase-messaging-sw.js as follows:

importScripts( "https://www.gstatic.com/firebasejs/10.12.5/firebase-app-compat.js" ); importScripts( "https://www.gstatic.com/firebasejs/10.12.5/firebase-messaging-compat.js" ); firebase.initializeApp({ ... }); const messaging = firebase.messaging(); 

After the modification Chrome is logging the following error every time a page loads:

Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://www.gstatic.com/firebasejs/10.12.5/firebase-app-compat.js' failed to load.
at https://.../firebase-messaging-sw.js:1:1

If we change firebase-messaging-sw.js back to

importScripts( "https://www.gstatic.com/firebasejs/10.12.4/firebase-app-compat.js" ); importScripts( "https://www.gstatic.com/firebasejs/10.12.4/firebase-messaging-compat.js" ); ... 

then the error message goes away.

Does anyone have ideas about what's causing this?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    close