Skip to content

The isSupported function is not exported from the Cloud messaging module for service worker in modular V9 SDK #5309

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

Closed
TomokiMiyauci opened this issue Aug 17, 2021 · 1 comment · Fixed by #5313

Comments

@TomokiMiyauci
Copy link

Describe your environment

  • Firebase SDK version: 9.0.0-beta.8
  • Firebase Product: messaging

Describe the problem

In firebase modular Web SDK(V9), the isSupported function is not exported from the firebase/messaging/sw module.

The documentation already has this function.
https://firebase.google.com/docs/reference/js/v9/messaging_sw.md#issupported

Steps to reproduce:

Relevant Code:

import { isSupported } from 'firebase/messaging/sw' // Bad
import { getMessaging, onBackgroundMessage } from 'firebase/messaging/sw' // OK

It is not that the type is missing, but it seems that the function does not actually exist.
When I bundle it using esbuild I get the following error.

errors: [
    {
      detail: undefined,
      location: {
        column: 9,
        file: 'src/workers/background_message.ts',
        length: 11,
        line: 3,
        lineText: "import { isSupported } from 'firebase/messaging/sw'",
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'No matching export in "node_modules/firebase/messaging/sw/dist/index.esm.js" for import "isSupported"'
    }
  ]
@jbalidiong
Copy link
Contributor

Hi @TomokiMiyauci, thanks for the report. I was able to reproduce the behavior. Let me check what we can do for this issue or bring someone here that can provide more context about it. I’ll update this thread if I have any information to share.

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

Successfully merging a pull request may close this issue.

4 participants