Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting errors while developing firebase-cloud-messaging app #617

Open
akash07k opened this issue Sep 16, 2021 · 5 comments
Open

Getting errors while developing firebase-cloud-messaging app #617

akash07k opened this issue Sep 16, 2021 · 5 comments

Comments

@akash07k
Copy link

Step 1: Describe your environment

  • Operating system: _____
  • Browser: _____
  • Firebase SDK version: _____

Step 2: Describe the problem:

Steps to reproduce:




Observed Results:

  • What happened? This could be a description, logs, etc.

Expected Results:

  • What did you expect to happen?

Relevant Code:

// TODO(you): code here to reproduce the problem

So I'm developing a firebase cloud messaging app and getting some issues.
I solved most of the issues by myself but still unable to find the solutions of some problems.
The problem here is that I'm using SDK V9 and the code in this repo is not using the moduler code.
Instead of it, still the old styled code is being used (compat) one and hence it is creating a lot of problem for new comers.
My code is in below repo:
https://github.com/firebase/quickstart-js
And the first issue which I'm having is:
FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('http://localhost:3000/firebase-cloud-messaging-push-scope') with script ('http://localhost:3000/firebase-messaging-sw.js'): ServiceWorker script evaluation failed (messaging/failed-service-worker-registration).
at registerDefaultSw (registerDefaultSw.ts:43)
at async updateSwReg (updateSwReg.ts:28)
at async getToken$1 (getToken.ts:43)

@iamnoufal
Copy link

iamnoufal commented Oct 11, 2021

you should create a firebase-messaging-sw.js in root

@Feroz-Istar
Copy link

It would be great if you please provide some sample code for firebase messaging as well.

@iamnoufal
Copy link

It would be great if you please provide some sample code for firebase messaging as well.

I've done a firebase cloud messaging model. Do visit my repo https://github.com/Rahman24/fcm-example for a code model

@sebastam97
Copy link

I have the same error when I go to version 9 and I don't know how to fix it, I followed the steps in the documentation and nothing i needed help

@iamnoufal
Copy link

I have the same error when I go to version 9 and I don't know how to fix it, I followed the steps in the documentation and nothing i needed help

What is you problem?
Please explain it briefly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants