stephen-moyer / ngx-signalr-hubservice

Makes using SignalR in Angular 2/4 easy
MIT License
24 stars 5 forks source link

Package is not supporting to Angular 9.1.9. #36

Open sandeepreddy1248 opened 4 years ago

sandeepreddy1248 commented 4 years ago

main.ts:12 Error: Angular JIT compilation failed: '@angular/compiler' not loaded!

Vitaly1025 commented 4 years ago

Same problem on Angular 10

TobiasBreuer commented 3 years ago

For anyone else reaching here: When using Angular 9+ with Ivy rendering and AOT compilation enabled, I had to explicitly import angular/compiler in my main.ts:

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import '@angular/compiler';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
    enableProdMode();
}

platformBrowserDynamic()
    .bootstrapModule(AppModule)
    .catch(err => console.log(err));

With the explicit import of import '@angular/compiler'; I'm now able to use this library with Angular 9

"@angular/core": "9.1.13",
"ngx-signalr-hubservice": "^9.0.1",

UPDATE Unfortunately, this only works if the optimization option in your build configuration in angular.json is set to false. So with the default settings of production-mode, it will still break with the above mentioned issue...

mzweers commented 3 years ago

Would like to run this with aot and optimization on, any workarounds/forks for this?