Skip to content

Auth package triggers errors (TS1254, TS2304) in version 9-beta 6 #5181

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
ghost opened this issue Jul 21, 2021 · 3 comments
Closed

Auth package triggers errors (TS1254, TS2304) in version 9-beta 6 #5181

ghost opened this issue Jul 21, 2021 · 3 comments
Milestone

Comments

@ghost
Copy link

ghost commented Jul 21, 2021

Description of the Issue
There seems to be a problem with the typings in @firebase/auth/dist/auth-exp-public.d.ts. On a freshly created Angular app I'm getting the following error trying to import any function from firebase/auth:

Error: 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;
985     static readonly EMAIL_PASSWORD_SIGN_IN_METHOD = SignInMethod.EMAIL_PASSWORD;
989     static readonly EMAIL_LINK_SIGN_IN_METHOD = SignInMethod.EMAIL_LINK;
993     readonly providerId = ProviderId.PASSWORD;
1113     static readonly FACEBOOK_SIGN_IN_METHOD = SignInMethod.FACEBOOK;
1115     static readonly PROVIDER_ID = ProviderId.FACEBOOK;
1368     static readonly GITHUB_SIGN_IN_METHOD = SignInMethod.GITHUB;
1370     static readonly PROVIDER_ID = ProviderId.GITHUB;
1437     static readonly GOOGLE_SIGN_IN_METHOD = SignInMethod.GOOGLE;
1439     static readonly PROVIDER_ID = ProviderId.GOOGLE;
2296     static readonly PROVIDER_ID = ProviderId.PHONE;
2298     static readonly PHONE_SIGN_IN_METHOD = SignInMethod.PHONE;
2300     readonly providerId = ProviderId.PHONE;
3220     static readonly TWITTER_SIGN_IN_METHOD = SignInMethod.TWITTER;
3222     static readonly PROVIDER_ID = ProviderId.TWITTER;

Error: node_modules/@firebase/auth/dist/auth-exp-public.d.ts:1491:18
error TS2304: Cannot find name 'ProviderId_2'.
1491     providerId?: ProviderId_2 | string;

Related Issues
I could only find this issue (beta-1) #4853.

Environment Configuration

Firebase JS SDK: 9.0.0-beta.6
Angular CLI: 12.1.2
Node: 14.17.3
Package Manager: npm 7.20.0
OS: darwin x64
Java: 1.8.0_291
Yarn: 1.22.10

Reproduce the Error

  • create an Angular app with ng new
  • call initializeApp
  • import anything from firebase/auth

Example code

// app.component.ts
import { Component } from '@angular/core';

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


@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html',
  styleUrls: ['app.component.scss'],
})
export class AppComponent {
  constructor() {

    const firebaseConfig = { ... }
    const app: FirebaseApp = initializeApp(firebaseConfig);
    console.log(app)

  }
}
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@Feiyang1
Copy link
Member

It should be fixed once the new beta release goes out (should be soon). It's fixed by #5118

@Feiyang1
Copy link
Member

This should have been fixed in 9.0.0-beta.7

@firebase firebase locked and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants