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.

Class constructor Subject cannot be invoked without 'new'

See original GitHub issue

I’m trying to migrate my app from Angular 7 to Angular 8, ng2-signalr is the last piece in my way.

The error I get is the following:

ERROR TypeError: Class constructor Subject cannot be invoked without 'new'
    at new BroadcastEventListener (vendor.js:198620)
    at ServerNotificationService.subscribeToEventType (main.js:7977)
    at new ServerNotificationService (main.js:7965)
    at vendor.js:38803
    at _callFactory (vendor.js:60799)
    at _createProviderInstance (vendor.js:60742)
    at resolveNgModuleDep (vendor.js:60701)
    at NgModuleRef_.get (vendor.js:61794)
    at resolveDep (vendor.js:62324)
    at createClass (vendor.js:62168)

ServerNotificationService.subscribeToEventType is doing something like:

    let onDismiss$ = new BroadcastEventListener<string>('dismissNotification')
    this._signalRConnection.listen(onDismiss$)
    onDismiss$.subscribe((guid) => {
      this.dismiss(guid, true)
    })

As Angular 8 defaults to es2015 and differential loading (https://www.i-programmer.info/news/167-javascript/12815-angular-8-adds-default-differential-loading-.html), we should probably have some work to adjust this library to work on this scenario.

Any thoughts?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

4reactions
thduttonukcommented, Jul 8, 2019

Released 8.0.2

1reaction
thduttonukcommented, Jul 8, 2019

@lattimoregay I have a fix going out, currently 8.0.1-beta1 works for me but I have some testing and cleanup to do before final release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript ES6 TypeError: Class constructor Client cannot be ...
When I try to execute nodemon command I always see this error TypeError: Class constructor Client cannot be invoked without 'new'.
Read more >
`TypeError: Class constructor cannot be invoked without 'new ...
Bug report. Getting the following error in my project: TypeError: Class constructor cannot be invoked without 'new'.
Read more >
Javascript ES6 TypeError Class constructor Client cannot be ...
When I try to execute nodemon command I always see this error TypeError: Class constructor Client cannot be invoked without 'new'.
Read more >
Reactjs " Class constructor upload cannot be invoked without ...
Reactjs " Class constructor upload cannot be invoked without 'new' ... Your react component's name is Upload, your function's name is also Upload, ......
Read more >
Jest fails with 'Class constructor Spec cannot be invoked ...
Jest fails with 'Class constructor Spec cannot be invoked without 'new'' · "Help | Find Action..." on the main menu; · Type "registry"...
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