Open sandeepreddy1248 opened 4 years ago
Same problem on Angular 10
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...
Would like to run this with aot and optimization on, any workarounds/forks for this?
main.ts:12 Error: Angular JIT compilation failed: '@angular/compiler' not loaded!