TrilonIO / aspnetcore-angular-universal

ASP.NET Core & Angular Universal advanced starter - PWA w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more! By @TrilonIO
https://www.trilon.io
MIT License
1.46k stars 433 forks source link

Class 'ConnectionResolver' incorrectly implements interface 'Resolve<SignalRConnection>' #301

Closed rob-weiss closed 7 years ago

rob-weiss commented 7 years ago

When trying to build the project I get the following error

ERROR in /Users/rob/Downloads/DataVisualisation/Client/app/shared/route.resolver.ts (7,14): Class 'ConnectionResolver' incorrectly implements interface 'Resolve<SignalRConnection>'.
      Types of property 'resolve' are incompatible.
        Type '() => ConnectInvocationResult' is not assignable to type '(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => SignalRConnection | Promise<Signal...'.
          Type 'ConnectInvocationResult' is not assignable to type 'SignalRConnection | Promise<SignalRConnection> | Observable<SignalRConnection>'.
            Type 'ConnectInvocationResult' is not assignable to type 'Observable<SignalRConnection>'.
              Property '_isScalar' is missing in type 'ConnectInvocationResult'.

I ran npm run build:dev in the root folder of the project. Both @angular/core and @angular/router are installed.

Thanks in advance for your help!

MarkPieszak commented 7 years ago

Was this with a fresh install of the Repo? I'm wondering if this might be coming from a 4.2.2 change in Angular.

rob-weiss commented 7 years ago

Yes, I just downloaded the repo a few hours ago. I'm new to ASP.NET and Angular, so I have never tried the template before.

markoj21 commented 7 years ago

The latest release of the https://github.com/HNeukermans/ng2-signalr/issues/60 has a bug.

The breaking change was introduced in version 2.0.5, version 2.0.4 still works.

rob-weiss commented 7 years ago

I just tried using version 2.0.4 but I still get the same error.

markoj21 commented 7 years ago

It should work, open the package.json file and update the following to "ng2-signalr": "2.0.4" Run npm install and you should be up and running.

rob-weiss commented 7 years ago

Awesome, now it's working! Thanks a lot guys, I appreciate your help!

Like @markoj21 said, I downloaded the repo again and changed the "ng2-signalr": "^2.0.2"to "ng2-signalr": "2.0.4". Leaving out the '^' is important in order to force npm to install this exact version.