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!
2 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.
-
0
Hi,
I need a person to support me this case. None of the responses from ABP Agent work for me!