{"record":{"id":"560087469122c7ea","repo":"angular/angular-cli","slug":"only-the-application-and-browser-esbuild-build","errorCode":null,"errorMessage":"Only the \"application\" and \"browser-esbuild\" builders support plugins.","messagePattern":"Only the \"application\" and \"browser-esbuild\" builders support plugins\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/build_angular/src/builders/dev-server/builder.ts","lineNumber":132,"sourceCode":"                  : buildApplicationInternal(options, context, { codePlugins });\n              },\n              context,\n              transforms,\n              extensions,\n            ),\n          ),\n        );\n      }\n\n      // Warn if the initial options provided by the user enable prebundling with Webpack-based builders\n      if (options.prebundle) {\n        context.logger.warn(\n          `Prebundling has been configured but will not be used because it is not supported by the \"${builderName}\" builder.`,\n        );\n      }\n\n      if (extensions?.buildPlugins?.length) {\n        throw new Error('Only the \"application\" and \"browser-esbuild\" builders support plugins.');\n      }\n      if (extensions?.middleware?.length) {\n        throw new Error(\n          'Only the \"application\" and \"browser-esbuild\" builders support middleware.',\n        );\n      }\n\n      // Webpack based build systems default to false for hmr option\n      normalizedOptions.hmr ??= false;\n\n      // Use Webpack for all other browser targets\n      return defer(() => import('./webpack-server')).pipe(\n        switchMap(({ serveWebpackBrowser }) =>\n          serveWebpackBrowser(normalizedOptions, builderName, context, transforms),\n        ),\n      );\n    }),\n  );","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/build_angular/src/builders/dev-server/builder.ts#L114-L150","documentation":"Build plugins (extensions.buildPlugins) are only supported by the esbuild-based builders (application, browser-esbuild). When the resolved builder is webpack-based, the dev-server throws to make clear the plugins would never be applied rather than silently dropping them.","triggerScenarios":"Passing extensions: { buildPlugins: [...] } into the dev-server execute() while the project's build target resolves to a webpack builder (browser); scheduling the dev-server programmatically with build plugins against a webpack-based project; a builderSelector that selects the webpack builder despite plugins being supplied.","commonSituations":"Using Angular build plugins (e.g. custom esbuild plugins for env injection) in a project that still uses the legacy browser builder; shared internal tooling that always attaches plugins regardless of builder; partial migration where tests use webpack builder but dev tooling assumes esbuild.","solutions":["Migrate the build target to '@angular/build:application' or 'browser-esbuild' so plugins are supported.","Remove buildPlugins from the extensions passed to the dev-server.","If plugins are conditionally added, guard them with isEsbuildBased(builderName) before passing.","Check which builder the build target resolves to (options.builderType / angular.json) and align tooling accordingly."],"exampleFix":"// before\nexecute(opts, { builderSelector }, { buildPlugins: [myPlugin()] })\n// after\nif (isEsbuildBased(builderName)) { extensions.buildPlugins = [myPlugin()]; }","handlingStrategy":"validation","validationCode":"const ESBUILD_BASED = new Set(['@angular/build:application', '@angular-devkit/build-angular:application', '@angular-devkit/build-angular:browser-esbuild']);\nif (extensions?.buildPlugins?.length && !ESBUILD_BASED.has(builderName)) {\n  throw new Error(`buildPlugins require an esbuild-based builder, got ${builderName}`);\n}","typeGuard":"const supportsPlugins = (builderName: string): boolean =>\n  /application|browser-esbuild/.test(builderName);","tryCatchPattern":"try {\n  await startDevServer(options, extensions);\n} catch (e) {\n  if (String(e.message).includes('support plugins')) {\n    // drop plugins or migrate build target to application builder\n  }\n  throw e;\n}","preventionTips":["Attach buildPlugins only for application/browser-esbuild targets","Confirm angular.json build target builder before dev tooling runs","Conditionally add plugins based on resolved builderName","Keep dev tooling and project builder type in sync during migration"],"tags":["angular","dev-server","plugins","esbuild","webpack"],"backgroundTag":"esbuild-plugins-unsupported-builder","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}