Skip to content

[Firebase 9][AUTH] Typescript cannot find AuthErrorCode enum when --isolatedModules is set. #5256

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
roguesherlock opened this issue Aug 8, 2021 · 1 comment · Fixed by #5260
Assignees
Milestone

Comments

@roguesherlock
Copy link

[REQUIRED] Describe your environment

  • Operating System version: macOS 11.5 (20G71)
  • Browser version: Version 92.0.4515.131 (Official Build) (x86_64)
  • Firebase SDK version: ^9.0.0-beta.8
  • Firebase Product: auth

[REQUIRED] Describe the problem

Typescript cannot find AuthErrorCode enum when --isolatedModules is set.

Steps to reproduce:

yarn run v1.22.10
warning package.json: No license field
$ tsc && vite build
node_modules/@firebase/auth/dist/auth-exp-public.d.ts:696:6 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

696     [AuthErrorCode.ARGUMENT_ERROR]: {
         ~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:699:6 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

699     [AuthErrorCode.DEPENDENT_SDK_INIT_BEFORE_AUTH]: {
         ~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:702:6 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

702     [AuthErrorCode.INTERNAL_ERROR]: {
         ~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:705:6 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

705     [AuthErrorCode.NO_AUTH_EVENT]: {
         ~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:708:6 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

708     [AuthErrorCode.MFA_REQUIRED]: {
         ~~~~~~~~~~~~~

node_modules/@firebase/auth/dist/auth-exp-public.d.ts:712:6 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

712     [AuthErrorCode.INVALID_CORDOVA_CONFIGURATION]: {
         ~~~~~~~~~~~~~


Found 6 errors.

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Relevant Issues/Discussions:

#4913
#4551
#4013
#5012
#5022

// TODO(you): code here to reproduce the problem
@Feiyang1
Copy link
Member

Feiyang1 commented Aug 9, 2021

Good catch. The const enums shouldn't be included in the public typings. #5260 will fix it.

@firebase firebase locked and limited conversation to collaborators Sep 13, 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