Skip to content

fix(release): change ngDevMode to isDevMode()#188

Merged
NetanelBasal merged 1 commit intongneat:masterfrom
Polatrite:isdevmode-check
Aug 21, 2025
Merged

fix(release): change ngDevMode to isDevMode()#188
NetanelBasal merged 1 commit intongneat:masterfrom
Polatrite:isdevmode-check

Conversation

@Polatrite
Copy link
Contributor

Angular best practice for checking dev mode, without conflicting global that doesn't pass Typescript's lib check.

Resolves #186, resolves #178

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: CONTRIBUTING.md#commit
  • [-] Tests for the changes have been added (for bug fixes / features)
  • [-] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Currently ngDevMode is declared as a global const with a signature that doesn't match the same global const exported by Angular. This results in TypeScript errors when tsconfig.json::compilerOptions.skipLibCheck is set to false.

Issue Number: N/A

What is the new behavior?

Instead of using ngDevMode, we use Angular's isDevMode() function to determine dev mode status, then take identical action as before.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Angular best practice for checking dev mode, without conflicting global that doesn't pass
Typescript's lib check.

Resolves ngneat#186, resolves ngneat#178
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NetanelBasal NetanelBasal merged commit 7cce49b into ngneat:master Aug 21, 2025
2 checks passed
@arturovt
Copy link
Collaborator

Angular does not declare best practices on using isDevMode() as this function returns ngDevMode, the solution was only to remove the module augmentation (declare ...).

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

Successfully merging this pull request may close these issues.

Iam receiving const ngDevMode: boolean; this error while trying to use it with Angular 19 ngDevMode problem with Angular 19.2

4 participants