{"record":{"id":"074b68f8bd10c7b2","repo":"angular/angular-cli","slug":"the-publichost-option-will-not-be-used-because-i","errorCode":null,"errorMessage":"The \"publicHost\" option will not be used because it is not supported by the \"${builderName}\" builder.","messagePattern":"The \"publicHost\" option will not be used because it is not supported by the \"(.+?)\" builder\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular_devkit/build_angular/src/builders/dev-server/builder.ts","lineNumber":82,"sourceCode":"\n  return defer(() => initialize(options, projectName, context, extensions?.builderSelector)).pipe(\n    switchMap(({ builderName, normalizedOptions }) => {\n      // Use vite-based development server for esbuild-based builds\n      if (isEsbuildBased(builderName)) {\n        if (transforms?.logging || transforms?.webpackConfiguration) {\n          throw new Error(\n            `The \"application\" and \"browser-esbuild\" builders do not support Webpack transforms.`,\n          );\n        }\n\n        if (options.publicHost) {\n          context.logger.warn(\n            `The \"publicHost\" option will not be used because it is not supported by the \"${builderName}\" builder.`,\n          );\n        }\n\n        if (options.disableHostCheck) {\n          context.logger.warn(\n            `The \"disableHostCheck\" option will not be used because it is not supported by the \"${builderName}\" builder.`,\n          );\n        }\n\n        // New build system defaults hmr option to the value of liveReload\n        normalizedOptions.hmr ??= normalizedOptions.liveReload;\n\n        // New build system uses Vite's allowedHost option convention of true for disabling host checks\n        if (normalizedOptions.disableHostCheck) {\n          (normalizedOptions as unknown as { allowedHosts: true }).allowedHosts = true;\n        } else {\n          normalizedOptions.allowedHosts ??= [];\n        }\n\n        return defer(() =>\n          Promise.all([import('@angular/build/private'), import('../browser-esbuild')]),\n        ).pipe(\n          switchMap(([{ serveWithVite, buildApplicationInternal }, { convertBrowserOptions }]) =>","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/build_angular/src/builders/dev-server/builder.ts#L64-L100","documentation":"When the resolved dev-server builder is an esbuild/Vite-based builder ('application' or 'browser-esbuild'), the 'publicHost' option is not supported; the builder warns that it will be ignored. The dev server starts, but the public host override has no effect.","triggerScenarios":"Running the dev-server builder resolved to an esbuild-based builder with `publicHost` set (e.g. for Docker/container or reverse-proxy setups).","commonSituations":"Serving inside containers/CI behind a proxy where publicHost was configured for the Webpack dev server; migrating to Vite-based serving and observing host/proxy behavior changes.","solutions":["Remove `publicHost` from the serve target options.","If you need the option, use the Webpack-based dev-server builder (acknowledging its deprecation).","Use the '@angular/build:dev-server' equivalent mechanisms (allowedHosts/disableHostCheck equivalents via Vite server config) where applicable."],"exampleFix":"// before\n\"options\": { \"publicHost\": \"myapp.local\" }\n// after\n\"options\": {}","handlingStrategy":"validation","validationCode":"if (usingEsbuildDevServer && target.options?.publicHost) {\n  delete target.options.publicHost; // ignored by esbuild-based builders\n}","typeGuard":"function setsPublicHost(o: unknown): o is { publicHost: string } {\n  return typeof o === 'object' && o !== null && typeof (o as any).publicHost === 'string';\n}","tryCatchPattern":null,"preventionTips":["Document host/proxy configuration per builder variant.","Test container/proxy serving setups after builder migrations.","Keep shared serve options minimal; use per-builder configurations."],"tags":["angular-cli","dev-server","build-options","vite"],"backgroundTag":"unsupported-builder-option","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}