angular/angular-cli · critical · Error

Angular app manifest is not set. Please ensure you are using

Error message

Angular app manifest is not set. Please ensure you are using the '@angular/build:application' builder to build your server application.

What it means

The server bundle expects the client build to register the AngularAppManifest via setAngularAppManifest (done automatically by @angular/build:application). If the global manifest is unset at runtime, the server bundle was not produced by that builder, so getAngularAppManifest throws to surface the misconfiguration.

Source

Thrown at packages/angular/ssr/src/manifest.ts:166

/**
 * Sets the Angular app manifest.
 *
 * @param manifest - The manifest object to set for the Angular application.
 */
export function setAngularAppManifest(manifest: AngularAppManifest): void {
  angularAppManifest = manifest;
}

/**
 * Gets the Angular app manifest.
 *
 * @returns The Angular app manifest.
 * @throws Will throw an error if the Angular app manifest is not set.
 */
export function getAngularAppManifest(): AngularAppManifest {
  if (!angularAppManifest) {
    throw new Error(
      'Angular app manifest is not set. ' +
        `Please ensure you are using the '@angular/build:application' builder to build your server application.`,
    );
  }

  return angularAppManifest;
}

/**
 * The Angular app engine manifest object.
 * This is used internally to store the current Angular app engine manifest.
 */
let angularAppEngineManifest: AngularAppEngineManifest | undefined;

/**
 * Sets the Angular app engine manifest.
 *
 * @param manifest - The engine manifest object to set.

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Switch server build to '@angular/build:application' (or @angular-devkit/build-angular:application) in angular.json
  2. Regenerate the app with ng add @angular/ssr to get the correct builder config and rebuild
  3. Ensure you run the built server output (dist/<project>/server.mjs), not a locally compiled main.server.js
  4. Update @angular/ssr and @angular/build to matching versions

Example fix

// before (angular.json server target)
"builder": "@angular-devkit/build-angular:server"
// after
"builder": "@angular/build:application"
Defensive patterns

Strategy: try-catch

Validate before calling

import { getAngularAppManifest } from '@angular/ssr';
try { getAngularAppManifest(); } catch { console.error('Server bundle not built with @angular/build:application'); }

Try / catch

try {
  const manifest = getAngularAppManifest();
} catch (e) {
  if (e instanceof Error && e.message.includes('app manifest is not set')) {
    console.error('Rebuild with the application builder: ng build');
    process.exit(1);
  }
  throw e;
}

Prevention

When it happens

Trigger: Serving a server bundle built with an old builder (@angular-devkit/build-angular:server) or webpack setup that never calls setAngularAppManifest, or running the SSR entry outside the built application context.

Common situations: Partial upgrade from legacy Universal setups, custom server builds (webpack/ts-node) compiling main.server directly, mixing builder versions between browser and server targets.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/fb635ef6a8ac30f7. Report an issue: GitHub.