question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No provider for NbAuthService!

See original GitHub issue

I have copied /framework/auth directory to my project src/app directory.

and i imported auth module into my app module

`/**

import { AppComponent } from ‘./app.component’; import { AppRoutingModule } from ‘./app-routing.module’; import { ThemeModule } from ‘./@theme/theme.module’; import { NgbModule } from ‘@ng-bootstrap/ng-bootstrap’;

import { NbAuthModule } from “./auth/auth.module”;

@NgModule({ declarations: [AppComponent], imports: [ BrowserModule, BrowserAnimationsModule, HttpModule, AppRoutingModule,

NgbModule.forRoot(),
ThemeModule.forRoot(),
CoreModule.forRoot(),

NbAuthModule,

], bootstrap: [AppComponent], providers: [ { provide: APP_BASE_HREF, useValue: ‘/’ }, ], }) export class AppModule { } and change my app-routing.module.ts to get auth components from copied directory import { NbAuthComponent, NbLoginComponent, NbLogoutComponent, NbRegisterComponent, NbRequestPasswordComponent, NbResetPasswordComponent, } from ‘./auth/components/index’;`

but when i try to access http://localhost:4200/#/auth/login i got error : ERROR Error: Uncaught (in promise): Error: No provider for NbAuthService! Error: No provider for NbAuthService!

can anyone help me? Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:24

github_iconTop GitHub Comments

3reactions
airportlycommented, Oct 29, 2017

any update on any documentation with examples of using an external auth provider such as auth0

2reactions
wozaisuzhoucommented, Mar 4, 2020

based on the current version of nebular , you just need to import the library import {NbThemeModule, NbLayoutModule, NbSidebarModule, NbButtonModule, NbMenuModule, NbSidebarService} from ‘@nebular/theme’;

and then add the “NbSidebarService” to your provider :

providers: [NbSidebarService],

it should be working

Read more comments on GitHub >

github_iconTop Results From Across the Web

StaticInjectorError(AppModule)[NbOAuth2AuthStrategy ...
StaticInjectorError(AppModule)[NbOAuth2AuthStrategy -> InjectionToken Window];NullInjectorError: No provider for InjectionToken Window.
Read more >
NbAuthService - Nebular
Customizable Angular UI Library based on Eva Design System with 40+ UI components, 4 visual themes, Auth and Security modules.
Read more >
[Debugging] NullInjectorError: No provider for {Class}!
In this video, you'll learn what the error "NullInjectorError: No provider for {Class}!" means, how to debug it, and prevent it from ...
Read more >
Top 5 @nebular/auth Code Examples - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... let authService: NbAuthService; let tokenService:...
Read more >
nbdialogref 没有提供程序, Ngx 管理员, Nullinjectorerror
No provider for NbAuthService ! · Issue #37 · akveo/nebular · GitHub. 为测试项目配置使用HttpClientTestingModule 非常有用。这个模块对测试非常有用,尤其是对 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found