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.

Strange $injector error on module load

See original GitHub issue
var myApp = angular.module("myApp", ['tmh.dynamicLocale']);

As soon as the module is included into my app’s module this error gets thrown:

Uncaught Error: [$injector:unpr] Unknown provider: $rootScopeProvider <- $rootScope <- tmhDynamicLocale

Libraries:

  • Angular 1.2.16
  • angular-dynamic-locale 0.1.9

edit

I removed the .run(['tmhDynamicLocale', angular.noop]); from the module and now it seems to be working.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
diaconesqcommented, Nov 26, 2015

I just ran into this issue too. Turns out it was user error.

When injecting, I used:

localeReader.$inject = ['tmh.DynamicLocale'];

instead of

localeReader.$inject = ['tmhDynamicLocale'];

(There is an extra dot in the 1st version).

It’s a bit confusing, because the name of the module is ‘tmh.DynamicLocale’ (with a dot), but the name of the exposed service is ‘tmhDynamicLocale’

0reactions
lgalfasocommented, Aug 7, 2014

Ok, thanks for the feedback. Closing this now, but if you run into this issue again, please feel free to reopen it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting a strange injector error - Unknown provider: bProvider
After compiling my code, I'm getting a strange error that I don't recognize. Usually with an $injector error I get a specific module...
Read more >
NullInjectorError: StaticInjectorError(AppModule) for lazy ...
We use loadChildren to target the wrapper module from the app so it loads the feature module from the package. But when we...
Read more >
Uncaught Error: [$injector:nomod] Module 'TodoListApp' is not ...
Maybe the flow of scripts gets interrupted by this and something weird happens.At a first glance the app looks fine and should work....
Read more >
angularjs + datatables directive throwing Error: $injector
We're running through a very strange error when using angularjs to load data from server. The data were loaded correctly but as we've...
Read more >
What you always wanted to know about Angular Dependency ...
Some time ago, when lazy loaded modules started to be widely used, one strange behavior was reported on github: dependency injection system caused...
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