Hi,
Steps to reproduce the issue:
- I've migrated ABP backend from v9.3.2 -> v10.0.3 done.
- I continue migrating ABP Angular app v9.3.2 -> v10.0.3.
- Fix issues of warnings/errors in codebase (our components).
- First issue, I get as below:
// root_effect_scheduler.mjs:3637
❌ ERROR RuntimeError: NG0200: Circular dependency detected for `_ConfigStateService`. Find more at https://v20.angular.dev/errors/NG0200
// main.ts:29
❌ RuntimeError: NG0200: Circular dependency detected for `_ConfigStateService`. Find more at https://v20.angular.dev/errors/NG0200
// root_effect_scheduler.mjs:3637
❌ ERROR ɵNotFound: NG0201: No provider found for `InjectionToken CORE_OPTIONS`. Find more at https://v20.angular.dev/errors/NG0201
- Next, I search the problem and I notice to add this
"@abp/*": ["node_modules/@abp/*"], "@volo/*": ["node_modules/@volo/*"]into tsconfig.json. In fact, it solves the problem. - Then, I get other issues as below
Exception message and full stack trace:
//root_effect_scheduler.mjs:3637
❌ ERROR ɵNotFound: NG0201: No provider found for `InjectionToken SORT_COMPARE_FUNC`. Find more at https://v20.angular.dev/errors/NG0201
at createRuntimeError (root_effect_scheduler.mjs:924:19)
at NullInjector.get (root_effect_scheduler.mjs:1494:27)
at R3Injector.get (root_effect_scheduler.mjs:2052:33)
at R3Injector.get (root_effect_scheduler.mjs:2052:33)
at R3Injector.retrieve (root_effect_scheduler.mjs:1936:25)
at injectInjectorOnly (root_effect_scheduler.mjs:1049:39)
at ɵɵinject (root_effect_scheduler.mjs:1061:42)
at inject2 (root_effect_scheduler.mjs:1149:12)
at new AbstractMenuService (abp-ng.theme.shared.mjs:1701:19)
at new _UserMenuService (abp-ng.theme.shared.mjs:2138:5)
// main.ts:22
❌ ɵNotFound: NG0201: No provider found for `InjectionToken SORT_COMPARE_FUNC`. Find more at https://v20.angular.dev/errors/NG0201
at createRuntimeError (root_effect_scheduler.mjs:924:19)
at NullInjector.get (root_effect_scheduler.mjs:1494:27)
at R3Injector.get (root_effect_scheduler.mjs:2052:33)
at R3Injector.get (root_effect_scheduler.mjs:2052:33)
at R3Injector.retrieve (root_effect_scheduler.mjs:1936:25)
at injectInjectorOnly (root_effect_scheduler.mjs:1049:39)
at ɵɵinject (root_effect_scheduler.mjs:1061:42)
at inject2 (root_effect_scheduler.mjs:1149:12)
at new AbstractMenuService (abp-ng.theme.shared.mjs:1701:19)
at new _UserMenuService (abp-ng.theme.shared.mjs:2138:5)
// abp-ng.core.mjs:159
❌ You should add @abp/ng-oauth packages or create your own auth packages.
Here is the public repository you can pull and verify: https://github.com/trietng-decisiontreetech/abp_angular_upgrade_10.0.3 Please let me know if you find something. Thank you in advance!
6 Answer(s)
-
0
Undo the
tsconfig.jsonpath mappings tonode_modules(the ones like@abp/*:node_modules/@abp/*,@volo/*:node_modules/@volo/*).
Those mappings can make Angular/TS resolve different physical copies / entry points of the same ABP packages and that commonly ends up as:- duplicated DI tokens (so you get “No provider found for InjectionToken …” even though you “provided” it),
- and circular DI graphs (like
_ConfigStateService).
Fix the
SORT_COMPARE_FUNCerror by registering its provider (only if you really need custom sorting).
If your app uses ABP menu/navigation sorting customization, you must provide the token:
// app.module.ts (or a core module that is imported once) import { NgModule } from '@angular/core'; import { SORT_COMPARE_FUNC } from '@abp/ng.core'; export function sortCompareFuncFactory() { return (a: any, b: any) => 0; // replace with your compare logic } @NgModule({ providers: [ { provide: SORT_COMPARE_FUNC, useFactory: sortCompareFuncFactory, }, ], }) export class AppModule {}If you don’t need custom sorting, the real fix is still the first bullet (stop forcing
@abp/*/@volo/*to resolve fromnode_modulesviapaths), because ABP’s own module should normally provide the default token.Fix the “You should add @abp/ng-oauth packages…” message by installing/including ABP’s Angular auth package (for v10 this is still the
@abp/ng.oauthpackage family). Ensure it’s referenced inpackage.jsonand that your app is bootstrapped with the ABP auth module/provider setup (otherwise you’ll get missingCORE_OPTIONS/ auth-related tokens as well).
(This error is emitted by ABP when no auth package is present/loaded.)Then clean-install dependencies to remove any duplicated dependency tree:
- delete
node_modulesand lock file (package-lock.jsonoryarn.lock) - reinstall (
npm cioryarn install) - run again
- delete
- https://abp.io/docs/10.0/release-info/migration-guides/abp-10-0
- https://abp.io/docs/latest/framework/ui/angular/sorting-navigation-elements
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.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
I need a person to support me this case. None of the responses from ABP Agent work for me!
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hello, Thank you for explaining the issue in detail. It may be related to a misconfigured installation. Could you add the following resolutions to your
package.jsonand try reinstalling?"resolutions": { "@ng-bootstrap/ng-bootstrap": "~19.0.0", "@volo/abp.commercial.ng.ui": "~10.0.3", "@volo/abp.ng.account": "~10.0.3" },You can let us know if you need further assistance. Thank you for your cooperation.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Thank you for your response. I followed your instruction and applied in both my real project & the public repository above.
The problem is still persisting. Please verify on your end to make sure you have the same issue!
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hello again,
I apologize for overlooking the project in your original question. After reviewing the project you shared, I noticed that some paths in the
tsconfig.jsonfile redirect tonode_modules. This approach is no longer supported. You can find more details here:https://abp.io/community/articles/angular-library-linking-made-easy-paths-workspaces-and-5z2ate6e#how-path-references-worked-before-the-new-angular-application-builder
/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "compileOnSave": false, "compilerOptions": { // ... "paths": { "product-service": ["src/product-service/public-api.ts"] // "@abp/*": ["node_modules/@abp/*"], // "@volo/*": ["node_modules/@volo/*"] }, "useDefineForClassFields": false }, }I also noticed that some package versions are not aligned. In particular, the Angular-related packages and the TypeScript version should match specific compatible versions. Unless you have a specific reason to use different versions, I recommend aligning them as follows:
{ "name": "angular-starter", "private": true, "engines": { "node": "^22.0.0" }, //... "resolutions": { "@ng-bootstrap/ng-bootstrap": "~19.0.0", "@volo/abp.commercial.ng.ui": "~10.0.3", "@volo/abp.ng.account": "~10.0.3" }, "dependencies": { "@abp/ng.components": "~10.0.3", "@abp/ng.feature-management": "~10.0.3", "@abp/ng.core": "~10.0.3", "@abp/ng.oauth": "~10.0.3", "@abp/ng.setting-management": "~10.0.3", "@abp/ng.tenant-management": "~10.0.3", "@abp/ng.theme.shared": "~10.0.3", "@abp/ng.theme.lepton-x": "~5.0.3", "@angular/animations": "~20.0.0", "@angular/common": "~20.0.0", "@angular/compiler": "~20.0.0", "@angular/core": "~20.0.0", "@angular/forms": "~20.0.0", "@angular/localize": "~20.0.0", "@angular/platform-browser": "~20.0.0", "@angular/platform-browser-dynamic": "~20.0.0", "@angular/router": "~20.0.0", //... "@volo/abp.commercial.ng.ui": "~10.0.3", "@volo/abp.ng.account": "~10.0.3", "@volo/abp.ng.audit-logging": "~10.0.3", "@volo/abp.ng.chat": "~10.0.3", "@volo/abp.ng.file-management": "~10.0.3", "@volo/abp.ng.gdpr": "~10.0.3", "@volo/abp.ng.identity": "~10.0.3", "@volo/abp.ng.language-management": "~10.0.3", "@volo/abp.ng.openiddictpro": "~10.0.3", "@volo/abp.ng.saas": "~10.0.3", "@volo/abp.ng.text-template-management": "~10.0.3", "@volosoft/abp.ng.theme.lepton-x": "~5.0.3", //... }, "devDependencies": { "@abp/ng.schematics": "~10.0.3", "@angular/build": "~20.0.0", "@angular-eslint/builder": "~20.0.0", "@angular-eslint/eslint-plugin": "~20.0.0", "@angular-eslint/eslint-plugin-template": "~20.0.0", "@angular-eslint/schematics": "~20.0.0", "@angular-eslint/template-parser": "~20.0.0", "@angular/cli": "~20.0.0", "@angular/compiler-cli": "~20.0.0", "@angular/language-service": "~20.0.0", "@types/file-saver": "^2.0.7", "@types/jasmine": "~3.6.0", "@types/jszip": "^3.4.0", "@types/node": "^20.17.16", "@typescript-eslint/eslint-plugin": "^8.50.0", "@typescript-eslint/parser": "^8.50.0", //... "typescript": "~5.8.0" } }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Thank you for your clarification! And it does solve the issue.
I find the root cause from your answers by adding
resolutions& upgradetheme.lepton-xrelated packages to~5.0.3.And removing
// "@abp/*": ["node_modules/@abp/*"], // "@volo/*": ["node_modules/@volo/*"]intsconfig.jsonfile// packages.json { // ... "resolutions": { "@ng-bootstrap/ng-bootstrap": "~19.0.0", "@volo/abp.commercial.ng.ui": "~10.0.3", "@volo/abp.ng.account": "~10.0.3" }, "dependencies": { // ... "@abp/ng.theme.lepton-x": "~5.0.3", // ... "@volosoft/abp.ng.theme.lepton-x": "~5.0.3" }, "devDependencies": { // ... } }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)