Skip to content

fix(vite): preserve SSR entry import order when registering manifests - #725

Open
nagahara-naoki wants to merge 1 commit into
voidzero-dev:mainfrom
nagahara-naoki:fix/ssr-manifest-import-order
Open

nagahara-naoki wants to merge 1 commit into
voidzero-dev:mainfrom
nagahara-naoki:fix/ssr-manifest-import-order

Conversation

@nagahara-naoki

@nagahara-naoki nagahara-naoki commented Nov 20, 2026 •

Copy link
Copy Markdown

Hi everyone!

An SSR entry can import @angular/compiler before @angular/ssr/node to initialize JIT support for externalized Angular libraries. The manifest plugin currently prepends its own import of @angular/ssr. With Angular 21.2.1 this makes the server fail on startup with JIT compilation failed for injectable [class PlatformLocation], even though the entry imports the compiler first.

Changes

Append a static import of a virtual module to the server entry. The entry's original dependencies now evaluate first, then the virtual module registers both manifests before the entry constructs AngularNodeAppEngine. The virtual module resolves Angular and the bootstrap relative to the original entry.

The regression test builds and executes an SSR entry and records the evaluation order. It uses JSX in a .js entry to exercise a custom Rolldown module type.

Checks

  • All 32 tests in ssr-manifest.test.ts passed. On the base commit, the new test records ssr before compiler.
  • Built a minimal app with Angular 21.2.1 and Vite 8.3.4. The built server returned HTTP 200 with the component rendered inside its custom root element.
  • A client-only edit during vite build --app --watch updated the client asset embedded in the server bundle.

Related to #60.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant