angular/angular-cli · warning

Warning: Forcing the use of the esbuild-based build system w

Error message

Warning: Forcing the use of the esbuild-based build system with third-party builders may cause unexpected behavior and/or build failures.

What it means

This warning comes from the dev-server's builder selector when `forceEsbuild` is enabled but the resolved builder is a third-party (non `@angular-devkit/build-angular:`) builder. Forcing the esbuild-based build system under an incompatible third-party builder bypasses that builder's own pipeline, so behavior may differ or builds may fail. It informs you the compatibility path is being overridden.

Source

Thrown at packages/angular_devkit/build_angular/src/builders/dev-server/builder.ts:217

  };
}

interface BuilderSelectorInfo {
  builderName: string;
  forceEsbuild: boolean;
}

function defaultBuilderSelector(
  info: BuilderSelectorInfo,
  logger: BuilderContext['logger'],
): string {
  if (isEsbuildBased(info.builderName)) {
    return info.builderName;
  }

  if (info.forceEsbuild) {
    if (!info.builderName.startsWith('@angular-devkit/build-angular:')) {
      logger.warn(
        'Warning: Forcing the use of the esbuild-based build system with third-party builders' +
          ' may cause unexpected behavior and/or build failures.',
      );
    }

    // The compatibility builder should be used if esbuild is force enabled.
    return '@angular-devkit/build-angular:browser-esbuild';
  }

  return info.builderName;
}

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Unset the `NG_BUILD_FORCE_ESBUILD` environment variable so the third-party builder runs natively
  2. If you want esbuild, migrate the project to the first-party `@angular/build:application` / `@angular/build:dev-server` builders
  3. Pin the third-party builder version that matches your Angular version to avoid needing the force flag
  4. If intentional, verify build output carefully since the warning signals unsupported behavior

Example fix

// before (env)
NG_BUILD_FORCE_ESBUILD=true ng serve
// after
unset NG_BUILD_FORCE_ESBUILD && ng serve
Defensive patterns

Strategy: validation

Validate before calling

// shell check before serving with third-party builders
if [ -n "$NG_BUILD_FORCE_ESBUILD" ]; then
  echo "NG_BUILD_FORCE_ESBUILD is set; third-party builders will be forced onto esbuild."
fi

Type guard

function isForcedThirdParty(builderName: string, forceEsbuild: boolean): boolean {
  return forceEsbuild && !builderName.startsWith('@angular-devkit/build-angular:');
}

Prevention

When it happens

Trigger: Setting `NG_BUILD_FORCE_ESBUILD=true` or equivalent force-esbuild option while running `ng serve` with a builder whose name does not start with `@angular-devkit/build-angular:`; raised in `defaultBuilderSelector`.

Common situations: Workspaces using community builders (e.g. custom webpack or nx extension builders) with the force-esbuild environment variable left set in CI or shell profile, or after migrating part of a project to esbuild while third-party builders remain configured.

Related errors


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