Hello ABP Support Team,
I’m facing persistent dependency compatibility issues in an ABP Angular UI project. The problem appears to come from the template’s dependency tree not being aligned with the Angular version used by the project, and it is currently blocking our CI/CD builds.
Impact
This issue prevents successful Angular compilation, causing our CI pipeline to fail and blocking deployments.
Environment
- Backend: .NET 10 (SDK/runtime)
- ABP packages:
@abp/ng.theme.shared@10.0.2(and related ABP Angular packages) - Angular:
@angular/*@20.0.7 - Node: [your version]
- Package manager: Yarn (CI) / npm (local)
Problem Summary
When installing dependencies and building the Angular app, I get peer dependency conflicts and, more importantly, TypeScript compilation errors caused by duplicate declarations from multiple copies of @angular/core being installed.
The dependency tree pulls @swimlane/ngx-datatable@21.1.0 via @abp/ng.theme.shared@10.0.2, but ngx-datatable@21.1.0 only declares peer support for Angular 17.x || 18.x || 19.x. With Angular 20 in the project, npm/yarn resolves/overrides peers and can end up with multiple Angular core typings, producing compilation failures.
Installation Warnings (excerpt)
npm warn While resolving: @swimlane/ngx-datatable@21.1.0
npm warn Found: @angular/core@20.0.7
npm warn Could not resolve dependency:
npm warn peer @angular/core@"17.x || 18.x || 19.x" from @swimlane/ngx-datatable@21.1.0
npm warn ... from @abp/ng.theme.shared@10.0.2
Build Error (blocking) (excerpt)
X [ERROR] TS2451: Cannot redeclare block-scoped variable 'ngI18nClosureMode'.
node_modules/angular-oauth2-oidc/node_modules/@angular/core/...d.ts:810:10
'ngI18nClosureMode' was also declared here.
node_modules/@angular/core/...d.ts:810:10
X [ERROR] TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.
node_modules/angular-oauth2-oidc/node_modules/@angular/core/...d.ts:22:10
'ngDevMode' was also declared here.
node_modules/@angular/core/...d.ts:22:10
This indicates multiple @angular/core copies/versions in the dependency tree (likely due to peer dependency mismatches).
Steps to Reproduce
- Use ABP Angular UI packages
10.0.2 - Set Angular to
20.0.7 - Run install (
yarn installornpm install) - Build (
yarn build/ng build) - Observe peer dependency warnings and TS redeclare errors
Expected Behavior
ABP Angular packages (and their transitive dependencies) should be compatible with the Angular version used by the project, or ABP should provide an updated dependency set / clear guidance to prevent multiple Angular versions from being installed.
Request
Could you please confirm:
- Which ABP Angular package version officially supports Angular 20?
- Whether
@abp/ng.theme.shared@10.0.2is expected to work with Angular 20. - If not yet supported, is there an updated ABP version (or recommended overrides/resolutions) that updates/replaces
ngx-datatableand prevents duplicate@angular/coreinstallations? - Recommended migration/upgrade path for ABP + Angular 20.
I can provide:
package.json+ lock fileyarn why @angular/coreoutput- Full install/build logs
Thanks in advance for your help.
1 Answer(s)
-
0
- Solution
Below is a concrete, “safe” way to get rid of the duplicate-
@angular/coreproblem and align your project with what ABP 10 expects.
1. Which ABP Angular version supports Angular 20?
ABP v10.0 Angular UI is designed to run on Angular 20:
- In the ABP 10.0 RC/10.0 release, Angular templates were migrated to the new esbuild-based Angular build system, explicitly mentioning Angular 20 support.
- So, ABP Angular 10.x (including
10.0.2) is the version line that officially targets Angular 20.
So, for Angular 20 you should be on:
"@abp/ng.core": "10.0.2", "@abp/ng.components": "10.0.2", "@abp/ng.theme.shared": "10.0.2", ... "@angular/*": "20.0.7" // or ~20.0.7(versions shown as example – key point is all ABP Angular packages in the 10.x line and all
@angular/*on a single 20.0.x version).
2. Is
@abp/ng.theme.shared@10.0.2expected to work with Angular 20?Yes.
@abp/ng.theme.shared@10.0.2belongs to the ABP 10.0 Angular UI stack, which is built for Angular 20.- Peer warnings from
@swimlane/ngx-datatable@21.1.0(17.x || 18.x || 19.x) are expected when you move to Angular 20 and do not, by themselves, break the build.
So from ABP’s side,
@abp/ng.theme.shared@10.0.2+ Angular 20 is a valid combination.
3. Why are you getting TS2451 “Cannot redeclare” errors and how to fix them?
The blocking errors you pasted:
TS2451: Cannot redeclare block-scoped variable 'ngI18nClosureMode'. node_modules/angular-oauth2-oidc/node_modules/@angular/core/...d.ts node_modules/@angular/core/...d.ts TS2451: Cannot redeclare block-scoped variable 'ngDevMode'. node_modules/angular-oauth2-oidc/node_modules/@angular/core/...d.ts node_modules/@angular/core/...d.tsshow that a second copy of
@angular/corewas installed under:node_modules/angular-oauth2-oidc/node_modules/@angular/coreThis is a general Node/Angular dependency resolution issue (not specific to ABP), typically caused by:
- Version misalignment in some
@angular/*packages or libraries that depend on them. - A lock file (
yarn.lock/package-lock.json) created with older ranges, causing npm/yarn to resolve a nested@angular/coreinside a dependency such asangular-oauth2-oidc.
This is not caused directly by
ngx-datatable. The peer warning fromngx-datatableis mostly cosmetic in this context; the real build break is the nested@angular/core.3.1. Normalize Angular & ABP versions
Make sure all your Angular & ABP Angular packages are on a single, consistent set of versions, without any
^ranges that could drift:Example (you can adapt the exact patch version to yours, like 20.0.7):
{ "dependencies": { "@angular/animations": "~20.0.7", "@angular/common": "~20.0.7", "@angular/compiler": "~20.0.7", "@angular/core": "~20.0.7", "@angular/forms": "~20.0.7", "@angular/localize": "~20.0.7", "@angular/platform-browser": "~20.0.7", "@angular/platform-browser-dynamic": "~20.0.7", "@angular/router": "~20.0.7", "@abp/ng.core": "10.0.2", "@abp/ng.components": "10.0.2", "@abp/ng.oauth": "10.0.2", "@abp/ng.theme.shared": "10.0.2", // ...other @abp/* and @volo/* at 10.0.2-compatible versions // Keep other libs, but avoid pinning their own @angular/* versions }, "devDependencies": { "@angular-devkit/build-angular": "~20.0.x", "@angular/cli": "~20.0.x", "@angular/compiler-cli": "~20.0.x", "@angular/language-service": "~20.0.x", // ... } }Key points:
- Use
~for@angular/*and exact (or~10.0.2) for ABP packages, like ABP support examples do for other Angular versions. - Avoid any dependency in your
package.jsonthat independently pulls in another@angular/coreversion.
3.2. Clean install to remove duplicate Angular trees
After normalizing versions:
- Delete
node_modules - Delete your lock file (
yarn.lockorpackage-lock.json) - Reinstall dependencies in a clean environment:
# if you use yarn yarn install # or npm npm install- Verify that you now have only one
@angular/core:
npm ls @angular/core # or yarn why @angular/coreYou must see only the root
@angular/core@20.0.7and no nested copy such asangular-oauth2-oidc/node_modules/@angular/core.If you still see a nested
@angular/coreunder any package, that package’s peer range conflicts strongly enough that npm/yarn is installing its own copy. In that case:- Try updating that library to a version compatible with Angular 20 (e.g. the latest
angular-oauth2-oidc). - If necessary, add a
resolutions/overridesblock (Yarn / npm v8+) to force a single Angular version:
{ "overrides": { "@angular/core": "20.0.7", "@angular/common": "20.0.7", "@angular/platform-browser": "20.0.7", "@angular/platform-browser-dynamic": "20.0.7" } }Then delete lockfile +
node_modulesand reinstall again.In ABP support tickets for earlier versions, very similar “dependency normalization” (pinning all
@angular/*,@abp/*,@volo/*to consistent~ranges and reinstalling) is exactly how build/startup issues were resolved.
4. What about
@swimlane/ngx-datatablespecifically?@swimlane/ngx-datatable@21.1.0is pulled in transitively by@abp/ng.theme.shared.- Its peer range (
17.x || 18.x || 19.x) is conservative; Angular 20 is newer, so npm/yarn warns. - In practice:
- This warning alone doesn’t break ABP’s Angular UI.
- The real breakage in your logs comes from
angular-oauth2-oidc(or another library) installing its own@angular/core.
So, you do not need to replace
ngx-datatablejust to get Angular 20 working. Focus on ensuring there is only one@angular/corein the tree as described above.If you want to be very strict in CI (treating warnings as errors), you can:
- Either relax that CI rule for peer-dependency warnings, or
- Replace
ngx-datatableusage in your own code with another grid solution and remove it from your direct dependencies. But ABP’s theme will still bring it transitively until ABP replaces it in a future version; there is no official statement yet that it has been fully removed.
5. Recommended migration/upgrade path for ABP + Angular 20
- Upgrade your solution to ABP 10.0.x using:
abp update(CLI), or- ABP Studio’s “Upgrade ABP Packages” action.
- Let the tool update:
- All NuGet packages to 10.0.x.
- All NPM ABP Angular packages to 10.0.x, including Angular CLI/config files.
- Ensure
package.json@angular/*and@abp/*versions match what a fresh ABP 10 Angular template would generate (this is the safest way to avoid hidden version drift). - Delete
node_modules+ lock file, reinstall. - Confirm:
npm ls @angular/coreshows a single 20.0.x install. 6. Re-run:
ng build --configuration productionin CI and locally.
This aligns your project with ABP’s official Angular 20 setup and eliminates the duplicate-core TS2451 errors.
- Sources
ABP 10.0 Migration Guide (includes .NET 10 and Angular 20 template changes):
https://abp.io/docs/10.0/release-info/migration-guides/abp-10-0ABP 10.0 RC Announcement (details Angular 20 / new esbuild-based builder and SSR for Angular UI):
https://abp.io/community/announcements/announcing-abp-10-0-release-candidate-86lrnyoxAngular UI Migration v2.9 → v3 (older, but shows ABP’s pattern of tightly coupling a specific Angular major to an ABP major):
https://abp.io/docs/latest/framework/ui/angular/migration-guide-v3
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.