Skip to content

Angular 8 target es2015 ng build --prod runtime error #14590

Closed
@MathewBerg

Description

@MathewBerg

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

No

Description

When switching the target in tsconfig.json from es5 to es2015 and running `ng build --prod` I get the below error if I try to run the website. The build succeeds.

🔬 Minimal Reproduction

I'm away all weekend and not near a computer. I was asked to re-create this from here: https://github.com/angular/angular/issues/30727. On monday if I have time and it's still needed I will try to get some repro steps.

🔥 Exception or Error

main-es2015.627b057467d9143e8c32.js:1 ERROR NullInjectorError: StaticInjectorError(i)[class{constructor(t,e,n,r,s,a,u){this.scheduler=new m.e(a,s),this.firestore=a.runOutsideAngular(()=>{const n=Object(m.f)(t,e).firestore();return n.settings(r||k),n}),this.persistenceEnabled$=n&&!Object(w.v)(s)?a.runOutsideAngular(()=>{try{return Object(i.a)(this.firestore.enablePersistence(u||void 0).then(()=>!0,()=>!1))}catch(t){return Object(o.a)(!1)}}):Object(o.a)(!1)}collection(t,e){let n;n="string"==typeof t?this.firestore.collection(t):t;const{ref:r,query:i}=x(n,e);return new y(r,i,this)}collectionGroup(t,e){if(I<6)throw"collection group queries require Firebase JS SDK >= 6.0";const n=e||(t=>t),r=this.firestore.collectionGroup(t);return new b(n(r),this)}doc(t){let e;return e="string"==typeof t?this.firestore.doc(t):t,new v(e,this)}createId(){return this.firestore.collection("_").doc().id}}]: 
  StaticInjectorError(Platform: core)[class{constructor(t,e,n,r,s,a,u){this.scheduler=new m.e(a,s),this.firestore=a.runOutsideAngular(()=>{const n=Object(m.f)(t,e).firestore();return n.settings(r||k),n}),this.persistenceEnabled$=n&&!Object(w.v)(s)?a.runOutsideAngular(()=>{try{return Object(i.a)(this.firestore.enablePersistence(u||void 0).then(()=>!0,()=>!1))}catch(t){return Object(o.a)(!1)}}):Object(o.a)(!1)}collection(t,e){let n;n="string"==typeof t?this.firestore.collection(t):t;const{ref:r,query:i}=x(n,e);return new y(r,i,this)}collectionGroup(t,e){if(I<6)throw"collection group queries require Firebase JS SDK >= 6.0";const n=e||(t=>t),r=this.firestore.collectionGroup(t);return new b(n(r),this)}doc(t){let e;return e="string"==typeof t?this.firestore.doc(t):t,new v(e,this)}createId(){return this.firestore.collection("_").doc().id}}]: 
    NullInjectorError: No provider for class{constructor(t,e,n,r,s,a,u){this.scheduler=new m.e(a,s),this.firestore=a.runOutsideAngular(()=>{const n=Object(m.f)(t,e).firestore();return n.settings(r||k),n}),this.persistenceEnabled$=n&&!Object(w.v)(s)?a.runOutsideAngular(()=>{try{return Object(i.a)(this.firestore.enablePersistence(u||void 0).then(()=>!0,()=>!1))}catch(t){return Object(o.a)(!1)}}):Object(o.a)(!1)}collection(t,e){let n;n="string"==typeof t?this.firestore.collection(t):t;const{ref:r,query:i}=x(n,e);return new y(r,i,this)}collectionGroup(t,e){if(I<6)throw"collection group queries require Firebase JS SDK >= 6.0";const n=e||(t=>t),r=this.firestore.collectionGroup(t);return new b(n(r),this)}doc(t){let e;return e="string"==typeof t?this.firestore.doc(t):t,new v(e,this)}createId(){return this.firestore.collection("_").doc().id}}!

🌍 Your Environment

Angular CLI: 8.0.0
Node: 10.15.3
OS: win32 x64
Angular: 8.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.0
@angular-devkit/build-angular     0.800.0
@angular-devkit/build-optimizer   0.800.0
@angular-devkit/build-webpack     0.800.0
@angular-devkit/core              8.0.0
@angular-devkit/schematics        8.0.0
@angular/fire                     5.2.0-rc.1
@ngtools/webpack                  8.0.0
@schematics/angular               8.0.0
@schematics/update                0.800.0
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions