Skip to content

Firebase v9 typescript declaration file fails to compile with error TS1254 #5118

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
prateekkumarweb opened this issue Jul 4, 2021 · 0 comments · Fixed by #5127
Closed

Firebase v9 typescript declaration file fails to compile with error TS1254 #5118

prateekkumarweb opened this issue Jul 4, 2021 · 0 comments · Fixed by #5127
Assignees
Milestone

Comments

@prateekkumarweb
Copy link

prateekkumarweb commented Jul 4, 2021

[REQUIRED] Describe your environment

  • Operating System version: Ubuntu 20.04
  • Browser version: Chrome 91
  • Firebase SDK version: 9.0.0-beta.6
  • Firebase Product: auth

[REQUIRED] Describe the problem

Typescript compiler fails with an error TS1254

Steps to reproduce:

mkdir testapp
cd testapp
npm init
npm i -D typescript firebase@beta

Create index.ts file with following content:

import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";

On compiling, the error is:

$ npx tsc index.ts
node_modules/@firebase/auth/dist/auth-exp-public.d.ts:981:35 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

981     static readonly PROVIDER_ID = ProviderId.PASSWORD;
                                      ~~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:985:53 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

985     static readonly EMAIL_PASSWORD_SIGN_IN_METHOD = SignInMethod.EMAIL_PASSWORD;
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:989:49 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

989     static readonly EMAIL_LINK_SIGN_IN_METHOD = SignInMethod.EMAIL_LINK;
                                                    ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:993:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

993     readonly providerId = ProviderId.PASSWORD;
                              ~~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:1113:47 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1113     static readonly FACEBOOK_SIGN_IN_METHOD = SignInMethod.FACEBOOK;
                                                   ~~~~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:1115:35 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1115     static readonly PROVIDER_ID = ProviderId.FACEBOOK;
                                       ~~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:1368:45 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1368     static readonly GITHUB_SIGN_IN_METHOD = SignInMethod.GITHUB;
                                                 ~~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:1370:35 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1370     static readonly PROVIDER_ID = ProviderId.GITHUB;
                                       ~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:1437:45 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1437     static readonly GOOGLE_SIGN_IN_METHOD = SignInMethod.GOOGLE;
                                                 ~~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:1439:35 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1439     static readonly PROVIDER_ID = ProviderId.GOOGLE;
                                       ~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:1491:18 - error TS2304: Cannot find name 'ProviderId_2'.

1491     providerId?: ProviderId_2 | string;
                      ~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:2296:35 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

2296     static readonly PROVIDER_ID = ProviderId.PHONE;
                                       ~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:2298:44 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

2298     static readonly PHONE_SIGN_IN_METHOD = SignInMethod.PHONE;
                                                ~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:2300:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

2300     readonly providerId = ProviderId.PHONE;
                               ~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:3220:46 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

3220     static readonly TWITTER_SIGN_IN_METHOD = SignInMethod.TWITTER;
                                                  ~~~~~~~~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:3222:35 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

3222     static readonly PROVIDER_ID = ProviderId.TWITTER;
                                       ~~~~~~~~~~~~~~~~~~


Found 16 errors.

Relevant Code:

See steps to reproduce

@Feiyang1 Feiyang1 added the v9 label Jul 4, 2021
@Feiyang1 Feiyang1 added this to the v9 GA milestone Jul 4, 2021
@sam-gc sam-gc self-assigned this Jul 8, 2021
@firebase firebase locked and limited conversation to collaborators Aug 9, 2021
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