Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): Error: Uncaught (in promise): TypeError: Class constructor Lh cannot be invoked without 'new' #3252

Closed
FrancescoBorzi opened this issue Dec 11, 2017 · 8 comments

Comments

@FrancescoBorzi
Copy link
Member

FrancescoBorzi commented Dec 11, 2017

Bug description or feature request:

With es6 enabled, I got this error (only in production):

main.16ed0bb01156b27f659a.bundle.js:1 ERROR Error: Uncaught (in promise): TypeError: Class constructor Lh cannot be invoked without 'new'
TypeError: Class constructor Lh cannot be invoked without 'new'

this is probably similar to: #3134

EDIT:

STEPS TO REPRODUCE:

  1. Clone this repo: https://github.com/ShinDarth/angular-test-app
  2. npm install
  3. ng serve --prod

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: ^2.0.0-beta.11

Angular: ^5.1.0

Bootstrap: ^3.3.7

Build system: Angular CLI

Angular CLI: 1.6.0
Node: 8.9.1
OS: linux x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.0
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/schematics: 0.0.10
typescript: 2.5.3
webpack: 3.10.0

@FrancescoBorzi
Copy link
Member Author

@IlyaSurmay I think this should be marked as urgent since it's quite a serious issue.

I updated the issue report with the repo and steps to reproduce the problem.

@IlyaSurmay
Copy link
Contributor

This may be related to angular/angular-cli#8379

@FrancescoBorzi
Copy link
Member Author

so do you think that's an Angular CLI bug?

@IlyaSurmay
Copy link
Contributor

Actually, no :) I found out that the reason is rxjs. Downgrading it to 5.4.3 is fixing this issue and prod mode with es6 works, checked this with your repo.

@FrancescoBorzi
Copy link
Member Author

Bug still present in:

Angular CLI: 1.6.4
Node: 8.9.1
OS: linux x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.4
@angular-devkit/build-optimizer: 0.0.37
@angular-devkit/core: 0.0.24
@angular-devkit/schematics: 0.0.45
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.4
@schematics/angular: 0.1.12
typescript: 2.6.2
webpack: 3.10.0

@valorkin
Copy link
Member

Should go away with rxjs 6

@ghost ghost removed the blocked label May 15, 2018
@FrancescoBorzi
Copy link
Member Author

@valorkin unfortunately I still get a similar error every time I set es6 as target in tsconfig.json AND I use --prod build.

Angular CLI: 6.1.4
Node: 8.10.0
OS: linux x64
Angular: 6.1.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.7.4
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.7.4
@angular-devkit/schematics 0.7.4
@angular/cli 6.1.4
@ngtools/webpack 6.0.8
@schematics/angular 0.7.4
@schematics/update 0.7.4
rxjs 6.2.2
typescript 2.9.2
webpack 4.8.3

@FrancescoBorzi
Copy link
Member Author

might be related to: #4428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants