Skip to content

[messaging] Change import in service worker #224

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

Merged
merged 6 commits into from
Sep 7, 2021

Conversation

jhuleatt
Copy link
Contributor

@jhuleatt jhuleatt commented Aug 17, 2021

The reference docs show a separate getMessaging function specifically for service workers. This PR updates the sample to use that instead of from firebase/messaging.

In my testing, importing getMessaging from firebase/messaging caused errors such as:

TypeError: Cannot read property 'addEventListener' of undefined

and

FirebaseError: Messaging: This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc) (messaging/indexed-db-unsupported).

@jhuleatt
Copy link
Contributor Author

leaving this as draft until firebase/firebase-js-sdk#5314 is resolved

@jhuleatt jhuleatt requested a review from egilmorez August 17, 2021 19:52
Copy link
Contributor

@egilmorez egilmorez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@jhuleatt jhuleatt marked this pull request as ready for review September 3, 2021 17:26
@jhuleatt jhuleatt enabled auto-merge (squash) September 3, 2021 19:47
@jhuleatt jhuleatt merged commit 2b9c321 into master Sep 7, 2021
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

Successfully merging this pull request may close these issues.

2 participants