{"record":{"id":"a76ea2073dfcb734","repo":"angular/angular-cli","slug":"server-asset-path-does-not-exist","errorCode":null,"errorMessage":"Server asset '${path}' does not exist.","messagePattern":"Server asset '(.+?)' does not exist\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular/ssr/src/assets.ts","lineNumber":32,"sourceCode":"export class ServerAssets {\n  /**\n   * Creates an instance of ServerAsset.\n   *\n   * @param manifest - The manifest containing the server assets.\n   */\n  constructor(private readonly manifest: AngularAppManifest) {}\n\n  /**\n   * Retrieves the content of a server-side asset using its path.\n   *\n   * @param path - The path to the server asset within the manifest.\n   * @returns The server asset associated with the provided path, as a `ServerAsset` object.\n   * @throws Error - Throws an error if the asset does not exist.\n   */\n  getServerAsset(path: string): ServerAsset {\n    const asset = this.manifest.assets[path];\n    if (!asset) {\n      throw new Error(`Server asset '${path}' does not exist.`);\n    }\n\n    return asset;\n  }\n\n  /**\n   * Checks if a specific server-side asset exists.\n   *\n   * @param path - The path to the server asset.\n   * @returns A boolean indicating whether the asset exists.\n   */\n  hasServerAsset(path: string): boolean {\n    return !!this.manifest.assets[path];\n  }\n\n  /**\n   * Retrieves the asset for 'index.server.html'.\n   *","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/ssr/src/assets.ts#L14-L50","documentation":"The asset manifest loaded by the server does not contain an entry for the requested path. getServerAsset is the lookup API for server assets (e.g. index.html) and throws when the path is absent from this.manifest.assets.","triggerScenarios":"Requesting getServerAsset('index.html') (or another path) when the server bundle was built without that asset emitted, wrong output path, or serving stale server bundles after a rebuild changed asset names.","commonSituations":"Server deployed with old dist folder while client assets were replaced, custom asset paths not listed in the builder options, running the server bundle directly (node dist/.../server.mjs) outside the built output context.","solutions":["Rebuild both client and server bundles with @angular/build:application so the manifest includes the asset","Ensure the served directory is the correct dist/<project> output and assets weren't deleted","Check the requested path spelling matches files emitted to the browser/server output","If loading a custom asset, add it to the build options 'assets' array"],"exampleFix":"// before\nconst asset = serverAssets.getServerAsset('index.dev.html');\n// after\nconst asset = serverAssets.getServerAsset('index.html');","handlingStrategy":"try-catch","validationCode":"const paths = serverAssets.getAvailablePaths();\nif (!paths.includes('index.html')) {\n  throw new Error('index.html missing from server assets; rebuild the app');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const asset = serverAssets.getServerAsset(path);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('does not exist')) {\n    console.error(`Asset ${path} missing; rebuild with @angular/build:application`);\n  }\n  throw e;\n}","preventionTips":["Always deploy the full dist folder produced by one build, never mix old/new assets","List custom assets in the builder options so they land in the manifest","Use getAvailablePaths() to verify expected assets before serving"],"tags":["ssr","assets","build"],"backgroundTag":"asset-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}