{"record":{"id":"fd278e956ace96f4","repo":"angular/angular-cli","slug":"unknown-error-occurred-processing-bundle-for-pa","errorCode":null,"errorMessage":"Unknown error occurred processing bundle for \"${path}\".","messagePattern":"Unknown error occurred processing bundle for \"(.+?)\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/build_angular/src/utils/process-bundle.ts","lineNumber":399,"sourceCode":"    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    inputSourceMap: false as any,\n    babelrc: false,\n    configFile: false,\n    presets: [\n      [\n        require.resolve('@babel/preset-env'),\n        {\n          targets: { esmodules: true },\n        },\n      ],\n    ],\n    minified: allowMinify && optimize,\n    compact: !shouldBeautify && optimize,\n    comments: !optimize,\n  });\n\n  if (!transformResult || !transformResult.code) {\n    throw new Error(`Unknown error occurred processing bundle for \"${path}\".`);\n  }\n\n  return transformResult.code;\n}\n","sourceCodeStart":381,"sourceCodeEnd":404,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/build_angular/src/utils/process-bundle.ts#L381-L404","documentation":"During the esbuild-based bundling of an Angular application, the transform result for a bundle (e.g. a chunk or locale data file) came back null/undefined or with no code. The devkit treats this as an unrecoverable, unexpected failure of the bundler rather than a user-facing build error, so it throws this generic message. It almost always indicates the esbuild transform pipeline itself failed silently (native binary mismatch, crash, or resource issue) rather than a problem in your source code.","triggerScenarios":"loadLocaleData/inlineLocales call process-bundle's transform path and esbuild's transform returns an empty result: corrupted or platform-mismatched esbuild native binary, esbuild crashing (OOM, unsupported platform), or a transform invoked with options that produce no output.","commonSituations":"Corrupted node_modules after switching Node versions or platforms (e.g. Docker image built on different arch), running out of memory during large builds, npm/yarn optional-dependency install bugs that skip the platform-specific @esbuild/* binary, stale Angular CLI cache.","solutions":["Delete node_modules and lockfile, reinstall (npm ci) so the correct @esbuild/<platform> binary is installed","Clear the Angular CLI cache (rm -rf .angular/cache)","Verify your Node version is in the supported range for your @angular-devkit/build_angular version and upgrade @angular-devkit/build_angular","If building in Docker, ensure the build stage runs on the same platform as the installed esbuild binary; avoid copying node_modules across platforms"],"exampleFix":"# before (broken install)\nnode_modules/@esbuild/linux-x64/bin/esbuild  # missing or wrong arch\n# after\nrm -rf node_modules package-lock.json\nnpm install","handlingStrategy":"try-catch","validationCode":"import { existsSync } from 'fs';\nconst esbuildBin = require.resolve('esbuild');\nif (!existsSync(esbuildBin)) throw new Error('esbuild missing; reinstall node_modules');\n// Also verify the platform binary:\ntry { require('@esbuild/linux-x64'); } catch { throw new Error('Platform esbuild binary missing; run npm ci'); }","typeGuard":"function hasCode(r: { code?: string } | null | undefined): r is { code: string } {\n  return !!r && typeof r.code === 'string' && r.code.length > 0;\n}","tryCatchPattern":"try {\n  await build(options);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('Unknown error occurred processing bundle')) {\n    // reinstall node_modules, clear .angular/cache, retry once\n  }\n  throw e;\n}","preventionTips":["Run npm ci (not incremental installs) when switching Node versions or platforms","Pin the exact @angular-devkit/build_angular and esbuild versions across the team and CI","Clear .angular/cache after upgrading tooling","Give CI builds adequate memory (esbuild can OOM on large bundles)"],"tags":["esbuild","bundling","build-tooling","angular-cli"],"backgroundTag":"esbuild-transform-empty-result","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}