Skip to content

Messaging undefined #637

Description

@93lucasp

Version

@nuxtjs/firebase: 8.2.2
firebase: 9.15.0
nuxt: 2.15.8

What is actually happening?

In the mounted $fire.messaging is undefined.

this is my configuration:

modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
    '@nuxtjs/auth-next',
    [
      '@nuxtjs/firebase',
      {
        config: {
          apiKey: "...",
          authDomain: "...",
          projectId: "...",
          storageBucket: "...",
          messagingSenderId: "...",
          appId: "...",
          measurementId: "..."
        },
        
        services: {
          messaging: {
            createServiceWorker: true,
            fcmPublicVapidKey: '...', 
            inject: fs.readFileSync('./serviceWorker.js') 
          },
        }
      }]
  ],

and this is the code inside the mounted:

 if (process.client) {
    console.log(this.$fire)
}

but it is undefined
Schermata 2022-12-19 alle 17 24 27

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions