Issue in using ngx-logger in an angular library (buildable)
See original GitHub issueHi guys, I am trying to use ngx-logger in my buildable library but I got the error below core.mjs:6500 ERROR NullInjectorError: R3InjectorError(AppModule)[TestService -> TestService -> TestService -> NGXLogger]: NullInjectorError: No provider for NGXLogger!
app/module
@NgModule({
....
imports: [
BrowserModule,
HttpClientModule,
LoggerModule.forRoot({
level: NgxLoggerLevel.DEBUG,
timestampFormat: 'HH:mm:ss.SSS',
serverLogLevel: NgxLoggerLevel.ERROR,
disableConsoleLogging: false
})]
})
export class AppModule { }
library module
@NgModule({
imports: [CommonModule, LoggerModule.forChild()]
})
export class ReusableModule {}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Build error with ngx-logger for Angular 11 project · Issue #216
I am getting below error in build as soon as I import the nx-logger Error: node_modules/ngx-logger/lib/logger.module.d.ts:3:22 - error ...
Read more >ngx-logger - npm
NGX Logger is a simple logging module for angular (currently supports angular 6+). It allows "pretty print" to the console, as well as...
Read more >ngx-logger-factory - npm Package Health Analysis - Snyk
It may not be fully compatible with current versions of Angular. Ngx-logger. Build Status. This is a simple library to log in Angular....
Read more >interact-logger - NPM Package Overview - Socket - Socket.dev
Interact logger library created using ngx-logger. It uses most of features of ngx-logger and customizes some of feature based on requirement. Build. Run...
Read more >Angular Logging Made Simple with ngx-logger - onthecode
As a developer, you are responsible for every line of code you write. If a bug surfaces in the application, you need to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok. I will create a simple app and reproduce the problem
I could not reproduce in a new project. it looks like is a real project that has config problems and I do not know where. this is the full error that I get
By the way, I am working on MFE and the services are a shared library. I use
providedIn: 'platform'
, so I have one instance of the service when there is more than one app loaded.