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.

Angular 8 target es2015 ng build --prod runtime error

See original GitHub issue

🐞 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?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
PSanetracommented, Jul 3, 2019

We could solve this issue by deleting our package-lock.json and reinstalling our dependencies with npm install again. This way some nested dependencies were removed from the package-lock.json and from the node_modules directory.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 30, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 8 target es2015 ng build --prod runtime error #30727
When switching the target in tsconfig.json from es5 to es2015 and running `ng build --prod` I get the below error if I try...
Read more >
Angular: Only building ES2015 on ng build --prod
Show activity on this post. I want the production build output to only produce ES2015 builds and not ES5 builds.
Read more >
Angular and Internet Explorer - InDepth.Dev
In this article we will discuss: Getting started with an Angular CLI application; The error in Internet Explorer; The steps necessary to support...
Read more >
Angular CLI - Quick Guide - Tutorialspoint
ng version command shows the Angular CLI version installed. ... When true, sets the build configuration to the production target. By default, the...
Read more >
Deployment - Angular
For the simplest deployment, create a production build and copy the output directory to a web server. Start with the production build: ng...
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