-
Notifications
You must be signed in to change notification settings - Fork 928
FirebaseError: Firebase: Need to provide options, when not being deployed to hosting via source. (app/no-options) #7262
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
Comments
Looking through the code, in general this error seems to happen when Either The situation may be different for other users reporting errors, but I think the error reflects If this doesn't seem to be the case for you, let me know. I will also work on getting a more helpful error message in this case. |
Hi @hsubox76 the |
The service worker is a different context and I don't think your main app (? is that what the second code block is?) can access variables in it. You should be calling Also it's best practice to pass the
It's not necessary, but explicit passing makes your code clearer and it helps you avoid mistakes, like in this case, in the second file (? I assume the second code block is a second file) you never created an |
Hi @hsubox76 I have updated the code with the angular fire imports and added get messaging however I still get the error: here is my service worker file firebase-messaging-sw.js:
Here's the service file:
Here is my app component file:
Please see the stacktrace below for the detailed error:
|
@hsubox76 The error doesn't point to the message service file anymore |
I don't know what the "service file" is or what role it plays in your app architecture, but I still don't see you calling I think as far as the SDK is concerned, I don't see a bug, as it definitely looks like you're not calling |
This is very worrying, I am following all these tutorials on how to set up Angular with FCM:
The fact that none of them, none of them are set up correctly means that there isn't a single working example of an Angular FCM project |
"app/no-options" error seen in service worker script as described in discussion here: #7180 (reply in thread)
For anyone else reporting this error, can you describe
Original discussion post copied below:
I am getting this error on my firebase app, here is my service worker file firebase-messaging-sw.js:
Here is my app component file:
Please see the stacktrace below for the detailed error:
I tried adding the auth information
I Tried registering the service worker on both the index and the messaging service class
I tried calling the service worker module on the app module and calling the register there
Still no luck
The text was updated successfully, but these errors were encountered: