Issue migrating from auth0-spa-js to auth0-angular

Please include the following information in your post:

  • Which SDK this is regarding: auth0-angular
  • SDK Version: 1.2.0
  • Platform Version: Angular 8.2.14
  • Code Snippets/Error Messages/Supporting Details/Screenshots:

I am migrating my Angular app from using the auth0-spa-js module to the new auth0-angular module, but after following the quick start guide I’m getting the following error message in my browser’s console:

ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[InjectionToken auth0.client -> AuthClientConfig]:
StaticInjectorError(Platform: core)[InjectionToken auth0.client -> AuthClientConfig]:
NullInjectorError: No provider for AuthClientConfig!
NullInjectorError: StaticInjectorError(AppModule)[InjectionToken auth0.client -> AuthClientConfig]:
StaticInjectorError(Platform: core)[InjectionToken auth0.client -> AuthClientConfig]:
NullInjectorError: No provider for AuthClientConfig!

The quick start guide was extremely simple and I believe I’ve set it up correctly. Here is the code I added in app.module.ts:
imports: [
AppRoutingModule,
AuthModule.forRoot({
domain: “mydomain”,
clientId: “myclientid”
}),
BrowserAnimationsModule,

1 Like

I added AuthClientConfig to my Providers list and then the app started throwing a similar error but with AbstractNavigator: NullInjectorError: No provider for AbstractNavigator!

So, I added AbstractNavigator to my Providers list then I started getting a compilation error: Module not found: Error: Can't resolve '@auth0/auth0-angular/lib/abstract-navigator' in 'MyAppDirectory\src\app' ...

I can confrim that @auth0/auth0-angular/lib/abstract-navigator/abstract-navigator.d.ts exists in my node_modules directory.

I have reinstalled the package and even tried downgrading it to 1.1.0 but it’s the same issue every time.

1 Like

I migrated my Angular app from 8.2 to 9.1 and the issue disappeared.

1 Like

Glad to hear that! Thanks for sharing it with the rest of community!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.