Skip to content

🐞[BUG]: const enum in @ngxs/storage-plugin causes TS2748 when using isolatedModules: true #2331

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

Open
xutzin opened this issue May 28, 2025 · 1 comment

Comments

@xutzin
Copy link

xutzin commented May 28, 2025

Affected Package

@ngxs/storage-plugin

Is this a regression?

Not sure

Description

Using @ngxs/storage-plugin with StorageOption enum causes a build error when isolatedModules is enabled in the TypeScript compiler options. This breaks compatibility with Angular CLI projects, where "isolatedModules": true is now enabled by default.

🔬 Minimal Reproduction

StackBlitz Reproduction

🔥 Exception or Error


✘ [ERROR] TS2748: Cannot access ambient const enums when 'isolatedModules' is enabled. [plugin angular-compiler]

    src/app.config.ts:16:17:
      16 │         storage: StorageOption.SessionStorage,

Environment


Libs:
- @angular/core version: 19.2.13
- @ngxs/store version: 19.0.0
 
For Tooling issues:
- Node version: 22.14.0

@arturovt
Copy link
Member

As a quick fix, use storage: 1 as StorageOption.SessionStorage,.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants