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): TypeError: Class constructor BehaviorSubject cannot be invoked without 'new' #3134

Closed
FrancescoBorzi opened this issue Nov 29, 2017 · 3 comments · Fixed by #3202
Assignees
Milestone

Comments

@FrancescoBorzi
Copy link
Member

FrancescoBorzi commented Nov 29, 2017

update by valorkin, thanks to ShinDarth:

  • issue happens when tsconfig target is es6
  • so workaround is to use es5 for now

It's a blocking issue to release v2

Fix: we should update build script to produce es5 and es2015(missing at the moment) version of ngx-bs

Bug description or feature request:

In my tsconfig.json when using "target": "es5" everything is fine, but if I use "target": "es6" I get the following console error every time there is an instance of the <timepicker>:

TypeError: Class constructor BehaviorSubject cannot be invoked without 'new'
    at new MiniState (state.class.js:21)
    at new TimepickerStore (timepicker.store.js:23)
    at createClass (core.js:10073)
    at _createProviderInstance (core.js:10052)
    at createProviderInstance (core.js:9895)
    at createViewNodes (core.js:11346)
    at callViewAction (core.js:11791)
    at execComponentViewsAction (core.js:11700)
    at createViewNodes (core.js:11387)
    at createRootView (core.js:11249)
    at new MiniState (state.class.js:21)
    at new TimepickerStore (timepicker.store.js:23)
    at createClass (core.js:10073)
    at _createProviderInstance (core.js:10052)
    at createProviderInstance (core.js:9895)
    at createViewNodes (core.js:11346)
    at callViewAction (core.js:11791)
    at execComponentViewsAction (core.js:11700)
    at createViewNodes (core.js:11387)
    at createRootView (core.js:11249)
    at resolvePromise (zone.js:824)
    at resolvePromise (zone.js:795)
    at eval (zone.js:873)
    at ZoneDelegate.invokeTask (zone.js:425)
    at Object.onInvokeTask (core.js:3856)
    at ZoneDelegate.invokeTask (zone.js:424)
    at Zone.runTask (zone.js:192)
    at drainMicroTaskQueue (zone.js:602)
    at ZoneTask.invokeTask [as invoke] (zone.js:503)
    at invokeTask (zone.js:1540)

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: ^2.0.0-beta.9

Angular: 5.0.3

Bootstrap: ^3.3.7

rxjs: ^5.5.2

Build system: Angular CLI, System.js, webpack, starter seed:

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

@angular/cli: 1.5.4
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.21
@angular-devkit/schematics: 0.0.37
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.4
@schematics/angular: 0.1.7
typescript: 2.4.2
webpack: 3.8.1
@FrancescoBorzi FrancescoBorzi changed the title core.js:1276 ERROR Error: Uncaught (in promise): TypeError: Class constructor BehaviorSubject cannot be invoked without 'new' TypeError: Class constructor BehaviorSubject cannot be invoked without 'new' TypeError: Class constructor BehaviorSubject cannot be invoked without 'new' Nov 29, 2017
@valorkin
Copy link
Member

can you try rxjs v^2.4?

@FrancescoBorzi
Copy link
Member Author

@valorkin valorkin changed the title TypeError: Class constructor BehaviorSubject cannot be invoked without 'new' fix(build): TypeError: Class constructor BehaviorSubject cannot be invoked without 'new' Dec 1, 2017
@valorkin valorkin added this to the v2.0.0 milestone Dec 1, 2017
@ghost ghost assigned IlyaSurmay Dec 5, 2017
@ghost ghost added the in progress label Dec 5, 2017
@ghost ghost removed the in progress label Dec 6, 2017
@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

Successfully merging a pull request may close this issue.

3 participants