Angularfire: Building for ES2015 with lazy loading produces StaticInjectorError

Created on 7 Jan 2019  路  4Comments  路  Source: angular/angularfire

Version info

Angular: 7.1.0

Firebase: 5.7.2

AngularFire: 5.1.1

How to reproduce these conditions

Failing test unit, Plunkr, or JSFiddle demonstrating the problem

https://github.com/mhartington/ng-fire

Steps to set up and reproduce

Clone the project, install deps, do a prod build, and serve the app (using httpster here)

git clone [email protected]:mhartington/ng-fire.git
cd ng-fire
npm install
ng build --prod
cd dist/ng-fire
httpster -s

Sample data and security rules

Sample project has all the data in place

Debug output

* Screenshots *

screen shot 2019-01-07 at 12 10 10 pm

Expected behavior

If you build for es5, the example app works as expected. You can access the AngularFireStorage module from lazy loaded components(routes).

Actual behavior

Targeting ES2015 or higher, the module will not load, unless it is provided in the lazy loaded module.

Most helpful comment

I'm having the same issue. Did you find a work around?

It's very frustrating this only happens with build prod.

Edit: Added photo of error as well if it helps
screen shot 2019-02-15 at 11 06 23 pm

All 4 comments

I'm having the same issue. Did you find a work around?

It's very frustrating this only happens with build prod.

Edit: Added photo of error as well if it helps
screen shot 2019-02-15 at 11 06 23 pm

I am having the same issue. I had to go back to targeting es5 until this is resolved.

Is this still an issue in 5.2? I fixed a couple issues related.

I have done a rebuild with 5.2.1 and everything does appear to be working again. I think I was on 5.2.0-rc3 when I had issues. Sorry to bother without updating the latest version. You should be able to close this issue now.

Was this page helpful?
0 / 5 - 0 ratings