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.

NullInjectorError: No provider for InjectorRef!

See original GitHub issue

I’m submitting a…

[x] support request
Unhandled Promise rejection: StaticInjectorError[InjectorRef]: 
  StaticInjectorError[InjectorRef]: 
    NullInjectorError: No provider for InjectorRef! ; Zone: angular ; Task: Promise.then ; Value: Error: StaticInjectorError[InjectorRef]: 
  StaticInjectorError[InjectorRef]: 
    NullInjectorError: No provider for InjectorRef!
    at _NullInjector.get (core.js:923)
    at resolveToken (core.js:1211)
    at tryResolveToken (core.js:1153)
    at StaticInjector.get (core.js:1024)
    at resolveToken (core.js:1211)
    at tryResolveToken (core.js:1153)
    at StaticInjector.get (core.js:1024)
    at resolveNgModuleDep (core.js:10585)
    at NgModuleRef_.get (core.js:11806)
    at resolveNgModuleDep (core.js:10585) Error: StaticInjectorError[InjectorRef]: 
  StaticInjectorError[InjectorRef]: 
    NullInjectorError: No provider for InjectorRef!
    at _NullInjector.get (webpack-internal:///../../../core/esm5/core.js:1119:19)
    at resolveToken (webpack-internal:///../../../core/esm5/core.js:1407:24)
    at tryResolveToken (webpack-internal:///../../../core/esm5/core.js:1349:16)
    at StaticInjector.get (webpack-internal:///../../../core/esm5/core.js:1220:20)
    at resolveToken (webpack-internal:///../../../core/esm5/core.js:1407:24)
    at tryResolveToken (webpack-internal:///../../../core/esm5/core.js:1349:16)
    at StaticInjector.get (webpack-internal:///../../../core/esm5/core.js:1220:20)
    at resolveNgModuleDep (webpack-internal:///../../../core/esm5/core.js:10781:25)
    at NgModuleRef_.get (webpack-internal:///../../../core/esm5/core.js:12002:16)
    at resolveNgModuleDep (webpack-internal:///../../../core/esm5/core.js:10781:25)
api.onUnhandledError @ zone.js:690
handleUnhandledRejection @ zone.js:717
_loop_1 @ zone.js:707
api.microtaskDrainDone @ zone.js:711
drainMicroTaskQueue @ zone.js:610
ZoneTask.invokeTask @ zone.js:503
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566

I got this error while loading one of my modules. I just spotted, the InjectorRef is part of angular-l10n project. Any idea what should I focus on? Thank you.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
macwiercommented, Oct 23, 2019

For anyone interested in this. Instead of doing normal npm link, I’ve solved this kind of problem with editing tsconfig.json (in the application workspace) and adding:

  • The library with absolute path
  • angular/* pointing to node_modules

I.e.

        "paths": {
            "my-library": [
                "C:\\repos\\my-library-app\\dist\\my-library"
            ],
            "@angular/*": [
                "node_modules/@angular/*"
            ],

Might be that all peer dependencies should be added like the @angular, but in the end this was enought to get rid of the error.

0reactions
robisim74commented, Nov 25, 2018

I’m closing this issue due to lack of repro. Feel free to reopen if you need. Greetings

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 7: NullInjectorError: No provider for PagerService
Following the error text, you have to import and add your PagerService in the Provider part of your app.module.ts file:
Read more >
NG0201: No provider for {token} found! - Angular
You see this error when you try to inject a service but have not declared a corresponding provider. A provider is a mapping...
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...
Read more >
Nullinjectorerror: No Provider For Router - ADocLib
configureTestingModule({ providers: [ { provide: ActivatedRoute, useValue:. StaticInjectorError(Platform: core)[HttpClient]: NullInjectorError: No provider for ...
Read more >
NullInjectorError: No provider for MDBModalService!
You shouldn't import main MDB Pro module and few modules separately. You have a typo in the main MDB module import. You're importing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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