From 00194210578c1eaf66a3cec4a3c810f4bc06249d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Tue, 14 Jan 2025 11:48:45 +0100 Subject: [PATCH] fix(angular): throw an error when providing `--serverRouting` in setup-ssr generator for webpack executors (#29614) ## Current Behavior ## Expected Behavior ## Related Issue(s) Fixes # --- .../src/generators/setup-ssr/lib/normalize-options.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/angular/src/generators/setup-ssr/lib/normalize-options.ts b/packages/angular/src/generators/setup-ssr/lib/normalize-options.ts index f7f9f7841cbbe..1bb7f7970daa1 100644 --- a/packages/angular/src/generators/setup-ssr/lib/normalize-options.ts +++ b/packages/angular/src/generators/setup-ssr/lib/normalize-options.ts @@ -33,6 +33,13 @@ export async function normalizeOptions( } else { options.serverRouting = false; } + } else if ( + options.serverRouting !== undefined && + !isUsingApplicationBuilder + ) { + throw new Error( + 'Server routing APIs can only be added to a project using `application` builder.' + ); } const isStandaloneApp = isNgStandaloneApp(tree, options.project);