Skip to content

typescript - Initializers are not allowed in ambient contexts #599

@abhishekp1996

Description

@abhishekp1996
  • Operating System version: Ubuntu 16.04
  • Firebase SDK version: Not sure
  • Library version: 8.2.0
  • Firebase Product: firebase-admin (auth, database, storage, etc)
  • Typescript version: 3.5.3

the problem

I am working on typescript project and after installing this library my typescript is not compiling. It shows the following error,

node_modules/@google-cloud/common/node_modules/google-auth-library/build/src/auth/oauth2client.d.ts:298:55 - error TS1039: Initializers are not allowed in ambient contexts.

298     protected static readonly GOOGLE_TOKEN_INFO_URL = "https://oauth2.googleapis.com/tokeninfo";

Steps to reproduce:

  1. Install the firebase-admin package
  2. Run the code, you get the error.

Strange Thing

When I compile this tsc code from an npm script it shows this error.
But when I do just tsc it doesn't show any warning.

Is anyone else facing the same error, or I am doing something wrong?

My typescript version is 3.5.3 and using NodeJS 10.X

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions