{"record":{"id":"78fd5d4a7ddb030b","repo":"angular/angular-cli","slug":"unknown-error-occurred-processing-bundle-for-op","errorCode":null,"errorMessage":"Unknown error occurred processing bundle for \"${options.filename}\".","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":190,"sourceCode":"      localeDataContent,\n    );\n    const transformResult = transformFromAstSync(ast, options.code, {\n      filename: options.filename,\n      // using false ensures that babel will NOT search and process sourcemap comments (large memory usage)\n      // The types do not include the false option even though it is valid\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      inputSourceMap: false as any,\n      babelrc: false,\n      configFile: false,\n      plugins,\n      compact: !shouldBeautify,\n      sourceMaps: !!options.map,\n    });\n\n    diagnostics.push(...localeDiagnostics.messages);\n\n    if (!transformResult || !transformResult.code) {\n      throw new Error(`Unknown error occurred processing bundle for \"${options.filename}\".`);\n    }\n    const subPath = i18n.locales[locale].subPath;\n    const outputPath = path.join(\n      options.outputPath,\n      i18n.flatOutput ? '' : subPath,\n      options.filename,\n    );\n    await fs.writeFile(outputPath, transformResult.code);\n\n    if (options.map && transformResult.map) {\n      const outputMap = remapping([transformResult.map as SourceMapInput, options.map], () => null);\n\n      await fs.writeFile(outputPath + '.map', JSON.stringify(outputMap));\n    }\n  }\n\n  return { file: options.filename, diagnostics };\n}","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/build_angular/src/utils/process-bundle.ts#L172-L208","documentation":"During per-locale transformation inside inlineLocales, after the localize transform runs the code checks that a transform result with code was produced. If the transform returned nothing (or no code), the library cannot write the translated bundle and throws this error naming the file being processed.","triggerScenarios":"The localize transform (via babel/localize plugins) returns a falsy result or a result without `code` for a given locale while processing options.filename.","commonSituations":"Version mismatches between @angular/localize plugins and build tooling, unsupported bundle content that the transformer silently fails on, or corrupted intermediate build artifacts.","solutions":["Re-run a clean build (delete node_modules/.cache and dist) to remove stale artifacts.","Ensure @angular/localize and @angular-devkit/build-angular versions are aligned in package.json.","Check that the transform inputs are valid; if it reproduces on a minimal bundle, report it to the Angular CLI repository."],"exampleFix":"// before\nnpx ng build --localize  // stale artifacts cause transformResult.code to be empty\n// after\nrm -rf node_modules/.cache dist && npx ng build --localize","handlingStrategy":"try-catch","validationCode":"if (typeof babelTransform !== 'function') throw new Error('Localize transform unavailable; check @angular/localize installation.');","typeGuard":"function hasTransformCode(r: unknown): r is { code: string } {\n  return typeof r === 'object' && r !== null && typeof (r as any).code === 'string' && (r as any).code.length > 0;\n}","tryCatchPattern":"try {\n  await inlineLocales(options);\n} catch (e) {\n  if (String(e.message).includes('Unknown error occurred processing bundle')) {\n    // clean rebuild / verify tool versions, then retry once\n  } else throw e;\n}","preventionTips":["Perform clean builds (remove dist and caches) in CI to avoid stale artifacts.","Pin matching versions of @angular/localize and @angular-devkit/build-angular.","Run the transform on a smoke-test bundle during toolchain upgrades.","Monitor upgrade PRs for known transformer regressions before bumping versions."],"tags":["i18n","angular-cli","transform","build"],"backgroundTag":"unexpected-null-result","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}