{"record":{"id":"d1f4116b307ecf03","repo":"angular/angular-cli","slug":"unknown-file-requested-path","errorCode":null,"errorMessage":"Unknown file requested: ${path}","messagePattern":"Unknown file requested: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/build_angular/src/builders/extract-i18n/ivy-extract-loader.ts","lineNumber":95,"sourceCode":"  let filename = loaderContext.resourcePath;\n  const mapObject =\n    typeof map === 'string' ? (JSON.parse(map) as Exclude<LoaderSourceMap, string>) : map;\n  if (mapObject?.file) {\n    // The extractor's internal sourcemap handling expects the filenames to match\n    filename = nodePath.join(loaderContext.context, mapObject.file);\n  }\n\n  // Setup a virtual file system instance for the extractor\n  // * MessageExtractor itself uses readFile, relative and resolve\n  // * Internal SourceFileLoader (sourcemap support) uses dirname, exists, readFile, and resolve\n  const filesystem = {\n    readFile(path: string): string {\n      if (path === filename) {\n        return content;\n      } else if (path === filename + '.map') {\n        return typeof map === 'string' ? map : JSON.stringify(map);\n      } else {\n        throw new Error('Unknown file requested: ' + path);\n      }\n    },\n    relative(from: string, to: string): string {\n      return nodePath.relative(from, to);\n    },\n    resolve(...paths: string[]): string {\n      return nodePath.resolve(...paths);\n    },\n    exists(path: string): boolean {\n      return path === filename || path === filename + '.map';\n    },\n    dirname(path: string): string {\n      return nodePath.dirname(path);\n    },\n  };\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const extractor = new MessageExtractor(filesystem as any, logger, {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/build_angular/src/builders/extract-i18n/ivy-extract-loader.ts#L77-L113","documentation":"In ivy-extract-loader, a minimal virtual filesystem object is created that only knows two paths: the synthesized extraction input file (`filename`) and its source map (`filename + '.map'`). Any other path passed to readFile throws 'Unknown file requested'. This guards consumers of the extractor against accidentally reading files this virtual FS cannot serve.","triggerScenarios":"The MessageExtractor (or other consumer) calls readFile with any path other than the exact `filename` or `filename + '.map'` strings — e.g. requesting an absolute variant of the filename, a sibling chunk, or a differently-cased path.","commonSituations":"Tooling inside @angular/localize/tools that resolves the input path to an absolute path before reading, mismatching the exact string comparison; custom extractors or plugins probing for additional files; localize version changes that read auxiliary files the loader does not provide.","solutions":["Check the exact path being requested vs. the loader's `filename` (log both; often it's an absolute vs relative path mismatch).","Update @angular/localize to a version compatible with your Angular CLI, where the extractor only requests the known files.","If you own the loader code, normalize the incoming path (path.resolve/isAbsolute) before comparison.","Ensure no plugin or custom extractor configuration causes reads of extra source files."],"exampleFix":"// before\nreadFile(path: string): string {\n  if (path === filename) { return content; }\n  ...\n}\n// after\nreadFile(path: string): string {\n  const resolved = nodePath.resolve(path);\n  if (resolved === nodePath.resolve(filename)) { return content; }\n  if (resolved === nodePath.resolve(filename + '.map')) { ... }\n  ...\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isLoaderKnownPath(path: string, filename: string): boolean {\n  return path === filename || path === filename + '.map';\n}","tryCatchPattern":"try {\n  return loader.readFile(path);\n} catch (e) {\n  if (e.message.startsWith('Unknown file requested')) {\n    return '';\n  }\n  throw e;\n}","preventionTips":["Only request the exact filename/filename+'.map' strings from the loader.","Normalize paths (resolve/normalize) before comparing.","Pin @angular/localize to a version compatible with your CLI.","Avoid plugins that probe the virtual FS for extra files."],"tags":["extract-i18n","filesystem","angular","virtual-fs"],"backgroundTag":"unknown-file-path","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}