Skip to content

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

@roguesherlock

Description

@roguesherlock

[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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions