angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.74k stars 11.98k forks source link

Internal server error: The injectable 'PlatformNavigation' needs to be compiled using the JIT compiler with 19.0.0-next.8 #28523

Open e-oz opened 3 days ago

e-oz commented 3 days ago

Which @angular/* package(s) are the source of the bug?

compiler

Is this a regression?

Yes

Description

Works fine with 19.0.0-next.7. When I update to 19.0.0-next.8 (parts that are available), I see this error:

 [vite] Internal server error: The injectable 'PlatformNavigation' 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 getCompilerFacade (/Users/oz/repos/packages/core/src/compiler/compiler_facade.ts:45:11)
      at Module.ɵɵngDeclareFactory (/Users/oz/repos/packages/core/src/render3/jit/partial.ts:107:20)
      at Function.<static_initializer> (/Users/oz/repos/packages/common/src/navigation/platform_navigation.ts:29:41)
      at <anonymous> (/Users/oz/repos/packages/common/src/dom_adapter.ts:25:4)
      at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
      at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:483:26)
      at async /Users/oz/repos/repo-folder/app-name/node_modules/@angular/build/src/tools/vite/middlewares/ssr-middleware.js:20:86 (x2)

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Angular 19.0.0-next.7 + 19.0.0-next.8
TS 5.6.2

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

Notice that /Users/oz/repos/packages/core is an incorrect path. Repo is located at /Users/oz/repos/repo-folder/

JeanMeche commented 2 days ago

Hi, I wasn't able to reproduce the issue with a brand new ng new project (CLI in next.8, framework in next.7).

Could you provide a repro repo, thank you.

alan-agius4 commented 2 days ago

This looks like it’s the same failure in https://github.com/angular/angular/pull/57880