Skip to content

Messaging example does not works #812

@emremutlu08

Description

@emremutlu08

Step 1: Describe your environment

Operating system: MacOS
Browser: Safari/Chrome
Firebase SDK version: 10.1.0

Step 2: Describe the problem:

I already gave the permissions however the ui is still asking for permissions. In the browser console, it says: "An error occurred while retrieving token. FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('http://localhost:5173/firebase-cloud-messaging-push-scope') with script ('http://localhost:5173/firebase-messaging-sw.js'): ServiceWorker script evaluation failed (messaging/failed-service-worker-registration). "
Screenshot 2024-07-19 at 11 03 46

Steps to reproduce:

  1. git clone https://github.com/firebase/quickstart-js
  2. cd messaging/
  3. fill config.ts
  4. npm install -g firebase-tools
  5. firebase login
  6. firebase use --add
  7. npm install
  8. firebase emulators:start
  9. npm run dev

Observed Results:

Expected Results:

  • What did you expect to happen?
    It should give me the notifications

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions