Ad
Error: StaticInjectorError On Deployed Angular CLI Project
We have an Error when deploying our Angular CLI (v.1.7.1) project to GitHub Pages, and Firebase - both give the same result.
The ng serve
works perfectly fine on localhost:4200
and all is going well when building production ng build --prod --base-href "https://<user-name>.github.io/<repo>/"
and ngh
command, the files are being loaded,
but when we open it, nothing comes up (just the blank index.html
) and we get the following error in the console:
main.e17a4a9….bundle.js:1 ERROR Error: StaticInjectorError(Ru)[e -> e]:
StaticInjectorError(Platform: core)[e -> e]:
NullInjectorError: No provider for e!
at e.get (main.e17a4a9….bundle.js:1)
at main.e17a4a9….bundle.js:1
at e (main.e17a4a9….bundle.js:1)
at e.get (main.e17a4a9….bundle.js:1)
at main.e17a4a9….bundle.js:1
at e (main.e17a4a9….bundle.js:1)
at e.get (main.e17a4a9….bundle.js:1)
at Ii (main.e17a4a9….bundle.js:1)
at main.e17a4a9….bundle.js:1
at Ni (main.e17a4a9….bundle.js:1)
Ad
Answer
Build your app with the optimization-feature disabled:
ng build --prod --optimization=false
This way, you'll see an error pointing to the real problem, instead of just "e".
Ad
source: stackoverflow.com
Related Questions
- → Make a Laravel collection into angular array (octobercms)
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → Angularjs not working inside laravel form
- → Analysis of Flux implementations
- → how to write react component to construct HTML DOM
- → angular ng-repeat and images in a row
- → Conditional BG Color on AngularJS
- → Should I 'use strict' for every single javascript function I write?
- → getting the correct record in Angular with a json feed and passed data
- → "Undefined is not a function" at .toBe fucntion
- → angularjs data binding issue
- → Angular / JavaScript auto hydrate an instance
- → Convert generic text string in json object into valid url using Angular
Ad