Skip to content

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

@TomokiMiyauci

Description

@TomokiMiyauci

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"'
    }
  ]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions