angular/angular-cli · error

*

Error message

*

What it means

When a Webpack build finishes unsuccessfully, buildWebpackBrowser logs the Webpack compilation diagnostics: warnings via statsWarningsToString and errors via statsErrorsToString (this entry's message '*' is the wildcard/first of the webpack stats errors). The builder then returns a failed BrowserBuilderOutput instead of emitting output files. The real message content comes from the webpack stats, e.g. TypeScript errors, module-not-found, or loader failures.

Source

Thrown at packages/angular_devkit/build_angular/src/builders/browser/index.ts:211

              throw new Error('Webpack stats build result is required.');
            }

            // Fix incorrectly set `initial` value on chunks.
            const extraEntryPoints = [
              ...normalizeExtraEntryPoints(options.styles || [], 'styles'),
              ...normalizeExtraEntryPoints(options.scripts || [], 'scripts'),
            ];

            const webpackStats = {
              ...webpackRawStats,
              chunks: markAsyncChunksNonInitial(webpackRawStats, extraEntryPoints),
            };

            if (!success) {
              // If using bundle downleveling then there is only one build
              // If it fails show any diagnostic messages and bail
              if (statsHasWarnings(webpackStats)) {
                context.logger.warn(statsWarningsToString(webpackStats, { colors: true }));
              }
              if (statsHasErrors(webpackStats)) {
                context.logger.error(statsErrorsToString(webpackStats, { colors: true }));
              }

              return {
                webpackStats: webpackRawStats,
                output: { success: false },
              };
            } else {
              outputPaths = ensureOutputPaths(baseOutputPath, i18n);

              const scriptsEntryPointName = normalizeExtraEntryPoints(
                options.scripts || [],
                'scripts',
              ).map((x) => x.bundleName);

              if (i18n.shouldInline) {

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Read the full webpack stats error text printed above this line and fix the first reported error.
  2. Run `tsc --noEmit` locally to reproduce TypeScript errors quickly.
  3. Verify missing modules: `npm install` the referenced package or correct the import path.
  4. Re-run `ng build` after fixes and confirm the build succeeds.
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check types before building
// npx tsc --noEmit -p tsconfig.json || exit 1

Try / catch

// Programmatic builder usage
try {
  const result = await lastValueFrom(scheduleTarget(target).pipe catchError(err => { log(err.message); return EMPTY; }));
  if (!result.success) { console.error(result.error ?? 'Build failed'); process.exit(1); }
} catch (e) {
  console.error('Build failed:', (e as Error).message);
  process.exit(1);
}

Prevention

When it happens

Trigger: Any webpack compilation failure in the 'browser' builder: TypeScript type errors, unresolved imports, missing assets, loader/plugin errors — statsHasErrors(webpackStats) is true and success is false.

Common situations: Importing a module with a wrong path or extension; type errors introduced by code changes; missing dependencies not installed in CI; incompatibility between a third-party package and webpack loaders.

Related errors


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