admin管理员组

文章数量:1291939

bootstrap:19 JIT compilation failed for injectable class a{static{this.ɵfac=i["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"18.2.13",ngImport:i,type:a,deps:[],target:i["ɵɵFactoryTarget"].Injectable})}static{this.ɵprov=i["ɵɵngDeclareInjectable"]({minV…
    s   @   bootstrap:19     
    s   @   bootstrap:19     
    (anonymous) @   jsonp chunk loading:86   
    (anonymous) @   app.main.ts:19   
    (anonymous) @   app.main.ts:19   
core.mjs:3493 Uncaught Error: The injectable 'a' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.
The injectable is part of a library that has been partially compiled. However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.
Ideally, the library is processed using the Angular Linker to become fully AOT compiled.
Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',
or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.
    at s (bootstrap:19:32)
    at s (bootstrap:19:32)
    at jsonp chunk loading:86:88
    at app.main.ts:19:72
    at app.main.ts:19:72

This is the error that I am getting when I am running the application on Chrome. I am migrating my angular project from angular 8 to 18 and have upgraded webpack to 5.74.

I tried to enable aot in webpack.prod.js and tsconfig-aot.json, but there is no help.

本文标签: JIT compilation failed for injectable class angular 18 and webpack 5Stack Overflow