From d95d4778955954b2246e506b1a910099ca8e3fcf Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Mon, 11 May 2026 08:52:46 +0000 Subject: [PATCH] fix(@angular/ssr): remove stateful flag from URL_PARAMETER_REGEXP Removes the stateful `/g` flag from `URL_PARAMETER_REGEXP`. Previously, calling `.test()` on the global regular expression advanced its internal `lastIndex` property. This caused subsequent evaluations in the route extraction pipeline to silently fail to match, skipping `getPrerenderParams` for parameterized routes. Closes #33154 --- packages/angular/ssr/src/routes/ng-routes.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/angular/ssr/src/routes/ng-routes.ts b/packages/angular/ssr/src/routes/ng-routes.ts index 438e8450d331..04f67c96d9d5 100644 --- a/packages/angular/ssr/src/routes/ng-routes.ts +++ b/packages/angular/ssr/src/routes/ng-routes.ts @@ -74,9 +74,14 @@ const MODULE_PRELOAD_MAX = 10; const CATCH_ALL_REGEXP = /\/(\*\*)$/; /** - * Regular expression to match segments preceded by a colon in a string. + * Regular expression to match a segment preceded by a colon in a string. */ -const URL_PARAMETER_REGEXP = /(?