Skip to content

Typescript Error: Type '"<<My VAPID key>>"' is not assignable to type '"<publicVapidKey>" | undefined'. #400

@JuanJoseGonGi

Description

@JuanJoseGonGi

Version

@nuxtjs/firebase: 7.1.1
firebase: 8.1.1
nuxt: 2.14.6
@nuxt/typescript-runtime: 2.0.0
@nuxt/types: 2.14.6
@nuxt/typescript-build: 2.0.3

Steps to reproduce

  1. Use nuxt typescript runtime. https://typescript.nuxtjs.org/guide/runtime

  2. Change nuxt.config.js by nuxt.config.ts

  3. Define the nuxt config as
    image
    and export it at the bottom
    image

  4. Add "types": ["@types/node", "@nuxt/types", "@nuxtjs/firebase"] on tsconfig.json file as specified on https://firebase.nuxtjs.org/tutorials/typescript

  5. Set fcmPublicVapidKey value to any string on nuxt.config.ts as shown below.
    image

What is Expected?

No error

What is actually happening?

Type '"any vapid key"' is not assignable to type '"<publicVapidKey>" | undefined'.
Maybe the types are wrong. The following image shows the type definition for fcmPublicVapidKey
image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions