René's URL Explorer Experiment


Title: @angular/ssr: getPrerenderParams silently skipped due to stateful /g regex in URL_PARAMETER_REGEXP · Issue #33154 · angular/angular-cli · GitHub

Open Graph Title: @angular/ssr: getPrerenderParams silently skipped due to stateful /g regex in URL_PARAMETER_REGEXP · Issue #33154 · angular/angular-cli

X Title: @angular/ssr: getPrerenderParams silently skipped due to stateful /g regex in URL_PARAMETER_REGEXP · Issue #33154 · angular/angular-cli

Description: Which @angular/* package(s) are the source of the bug? @angular/ssr Is this a regression? No Description When multiple parameterized routes use RenderMode.Prerender with getPrerenderParams, some routes are silently skipped — getPrerender...

Open Graph Description: Which @angular/* package(s) are the source of the bug? @angular/ssr Is this a regression? No Description When multiple parameterized routes use RenderMode.Prerender with getPrerenderParams, some ro...

X Description: Which @angular/* package(s) are the source of the bug? @angular/ssr Is this a regression? No Description When multiple parameterized routes use RenderMode.Prerender with getPrerenderParams, some ro...

Opengraph URL: https://github.com/angular/angular-cli/issues/33154

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@angular/ssr: getPrerenderParams silently skipped due to stateful /g regex in URL_PARAMETER_REGEXP","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\n@angular/ssr\n\n### Is this a regression?\n\nNo\n\n### Description\n\nWhen multiple parameterized routes use `RenderMode.Prerender` with `getPrerenderParams`, some routes are silently skipped — `getPrerenderParams` is never called, no prerendered HTML is produced, and no warning is emitted. The build reports \"Prerendered N static routes\" with N lower than expected.\n\n### Root cause\n\nIn `@angular/ssr/fesm2022/ssr.mjs`, function `handleSSGRoute`:\n\n```js\nconst URL_PARAMETER_REGEXP = /(?\u003c!\\\\):([^/]+)/g;  // \u003c-- /g flag\n\nif (isCatchAllRoute && !getPrerenderParams ||\n    !isCatchAllRoute && !URL_PARAMETER_REGEXP.test(currentRoutePath)) {\n  yield { ...meta };  // early return, getPrerenderParams never called\n  return;\n}\n```\n\nThe `/g` flag makes `RegExp.prototype.test()` stateful — `lastIndex` persists across calls. After a successful match, the next `.test()` call starts mid-string and may return `false` for a path that *does* contain a parameter. The route is then treated as static and yielded without invoking `getPrerenderParams`.\n\n### Standalone reproduction (no Angular needed)\n\n```js\nconst URL_PARAMETER_REGEXP = /(?\u003c!\\\\):([^/]+)/g;\nconsole.log(URL_PARAMETER_REGEXP.test('blog/:slug'));            // true\nconsole.log(URL_PARAMETER_REGEXP.test('blog/kategorie/:cat'));   // false  ← BUG\n```\n\n### Suggested fix\n\nDrop the `/g` flag (not needed for `.test()`), or reset `lastIndex` before each test:\n\n```diff\n   const isCatchAllRoute = CATCH_ALL_REGEXP.test(currentRoutePath);\n+  URL_PARAMETER_REGEXP.lastIndex = 0;\n   if (isCatchAllRoute && !getPrerenderParams || !isCatchAllRoute && !URL_PARAMETER_REGEXP.test(currentRoutePath)) {\n```\n\n### Please provide a link to a minimal reproduction of the bug\n\n_No response_\n\n### Please provide the exception or error you saw\n\n```true\nNo exception. The bug is silent: getPrerenderParams is not invoked for affected routes, and the build log reports a lower count of prerendered routes than expected without any warning.\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular           : 21.2.4\nNode.js           : 22.14.0\nPackage Manager   : pnpm 10.6.5\nOperating System  : win32 x64\n\nPackage                     Installed Version  Requested Version\n@angular/build              21.2.2             ^21.2.2\n@angular/cdk                21.2.2             ^21.2.2\n@angular/cli                21.2.2             ^21.2.2\n@angular/common             21.2.4             ^21.2.0\n@angular/compiler           21.2.4             ^21.2.0\n@angular/compiler-cli       21.2.4             ^21.2.0\n@angular/core               21.2.4             ^21.2.0\n@angular/forms              21.2.4             ^21.2.0\n@angular/material           21.2.2             ^21.2.2\n@angular/platform-browser   21.2.4             ^21.2.0\n@angular/platform-server    21.2.4             ^21.2.0\n@angular/router             21.2.4             ^21.2.0\n@angular/ssr                21.2.2             ^21.2.2\nrxjs                        7.8.2              ~7.8.0\ntypescript                  5.9.3              ~5.9.2\n```\n\n### Anything else?\n\nAlso reproduced with `@angular/ssr` 21.2.10 and 22.0.0-next.7 by patching the file in `node_modules` and rerunning the build — the same routes are skipped without the `lastIndex = 0` fix.\n\nCurrently working around this via `pnpm patch`:\n\n```diff\n   const isCatchAllRoute = CATCH_ALL_REGEXP.test(currentRoutePath);\n+  URL_PARAMETER_REGEXP.lastIndex = 0;\n   if (isCatchAllRoute && !getPrerenderParams || !isCatchAllRoute && !URL_PARAMETER_REGEXP.test(currentRoutePath)) {\n```\n\nBefore patch: 7 of 11 expected parameterized routes were prerendered.\nAfter patch: all 20 routes correctly prerendered.\n\nHappy to submit a PR if helpful.","author":{"url":"https://github.com/SvenBudak","@type":"Person","name":"SvenBudak"},"datePublished":"2026-05-09T03:26:41Z","url":"https://github.com/angular/angular-cli/issues/33154"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0d66d24c-7c06-7b76-0fea-4108949b84cf
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC29E:68C46:4902D5:64AB23:6AFDE5AC
html-safe-nonce07b02d7fb771d828bc15f44da67c68e633b3a2e634505d0199e3db77cabe5327
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjlFOjY4QzQ2OjQ5MDJENTo2NEFCMjM6NkFGREU1QUMiLCJ2aXNpdG9yX2lkIjoiNTYwNjc3MDU3NzY2NzY0Njg5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbb93887583d9b7f8ccdc324bb606eb5e5d4241557b10a8cfeaf60edb0f59fcf5
hovercard-subject-tagissue:4411978365
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/33154/issue_layout
twitter:imagehttps://opengraph.githubassets.com/48a289b762d5e6efef123a6f69c7971a15728468bffb7817d06095befd1b3fff/angular/angular-cli/issues/33154
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/48a289b762d5e6efef123a6f69c7971a15728468bffb7817d06095befd1b3fff/angular/angular-cli/issues/33154
og:image:altWhich @angular/* package(s) are the source of the bug? @angular/ssr Is this a regression? No Description When multiple parameterized routes use RenderMode.Prerender with getPrerenderParams, some ro...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSvenBudak
hostnamegithub.com
expected-hostnamegithub.com
None91ef1a291a064ac31ac459ab3f75261dbdd924c41ea5bd027e591c5b46cc9ce7
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released62bc98ce2346f4006e4a2810e9e22f37e7e6422
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/33154#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F33154
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F33154
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/33154
Reloadhttps://github.com/angular/angular-cli/issues/33154
Reloadhttps://github.com/angular/angular-cli/issues/33154
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues196 (196)https://github.com/angular/angular-cli/issues
Pull requests20 (20)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
https://github.com/angular/angular-cli
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/33154
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/33154
#33159https://github.com/angular/angular-cli/pull/33159
@angular/ssr: getPrerenderParams silently skipped due to stateful /g regex in URL_PARAMETER_REGEXPhttps://github.com/angular/angular-cli/issues/33154#top
#33159https://github.com/angular/angular-cli/pull/33159
https://github.com/alan-agius4
area: @angular/ssrhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular%2Fssr%22
gemini-triagedLabel noting that an issue has been triaged by geminihttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22gemini-triaged%22
needsTriagehttps://github.com/angular/angular-cli/milestone/11
https://github.com/SvenBudak
SvenBudakhttps://github.com/SvenBudak
on May 9, 2026https://github.com/angular/angular-cli/issues/33154#issue-4411978365
angular-robothttps://github.com/apps/angular-robot
gemini-triagedLabel noting that an issue has been triaged by geminihttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22gemini-triaged%22
on May 9, 2026https://github.com/angular/angular-cli/issues/33154#event-25335840414
angular-robothttps://github.com/apps/angular-robot
needsTriagehttps://github.com/angular/angular-cli/milestone/11
on May 9, 2026https://github.com/angular/angular-cli/issues/33154#event-25335840425
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular-cli/milestone/11
on May 9, 2026https://github.com/angular/angular-cli/issues/33154#event-25335840431
https://github.com/SkyZeroZx
SkyZeroZxhttps://github.com/SkyZeroZx
on May 9, 2026https://github.com/angular/angular-cli/issues/33154#issuecomment-4412134497
https://github.com/angular/angular-clihttps://github.com/angular/angular-cli
JoostKhttps://github.com/JoostK
angular/angularhttps://github.com/angular/angular
on May 9, 2026https://github.com/angular/angular-cli/issues/33154#event-25335840450
angular-robothttps://github.com/apps/angular-robot
area: @angular/ssrhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular%2Fssr%22
on May 9, 2026https://github.com/angular/angular-cli/issues/33154#event-25335842700
alan-agius4https://github.com/alan-agius4
on May 11, 2026https://github.com/angular/angular-cli/issues/33154#event-25372230971
fix(@angular/ssr): remove stateful flag from URL_PARAMETER_REGEXPhttps://github.com/alan-agius4/angular-cli/commit/5124e2b86f606403500bf78dfff80505c4ca9d86
https://docs.github.com/articles/closing-issues-via-commit-messages
5124e2bhttps://github.com/alan-agius4/angular-cli/commit/5124e2b86f606403500bf78dfff80505c4ca9d86
fix(@angular/ssr): remove stateful flag from URL_PARAMETER_REGEXPhttps://github.com/alan-agius4/angular-cli/commit/07fecf036c1381cd77bc477a8170d518d308e95b
https://docs.github.com/articles/closing-issues-via-commit-messages
07fecf0https://github.com/alan-agius4/angular-cli/commit/07fecf036c1381cd77bc477a8170d518d308e95b
alan-agius4https://github.com/alan-agius4
on May 11, 2026https://github.com/angular/angular-cli/issues/33154#event-25373487794
alan-agius4https://github.com/alan-agius4
on May 12, 2026https://github.com/angular/angular-cli/issues/33154#event-25417422068
fix(@angular/ssr): remove stateful flag from URL_PARAMETER_REGEXPhttps://github.com/alan-agius4/angular-cli/commit/d95d4778955954b2246e506b1a910099ca8e3fcf
https://docs.github.com/articles/closing-issues-via-commit-messages
d95d477https://github.com/alan-agius4/angular-cli/commit/d95d4778955954b2246e506b1a910099ca8e3fcf
alan-agius4https://github.com/alan-agius4
completedhttps://github.com/angular/angular-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#33159https://github.com/angular/angular-cli/pull/33159
on May 12, 2026https://github.com/angular/angular-cli/issues/33154#event-25444104915
alan-agius4https://github.com/alan-agius4
on May 12, 2026https://github.com/angular/angular-cli/issues/33154#event-25444107650
fix(@angular/ssr): remove stateful flag from URL_PARAMETER_REGEXPhttps://github.com/angular/angular-cli/commit/ea95e1a87ebfb5b452a6b6ffa7838ca1fe094100
https://docs.github.com/articles/closing-issues-via-commit-messages
ea95e1ahttps://github.com/angular/angular-cli/commit/ea95e1a87ebfb5b452a6b6ffa7838ca1fe094100
fix(@angular/ssr): remove stateful flag from URL_PARAMETER_REGEXPhttps://github.com/angular/angular-cli/commit/7a116a80d7e6db341fd003737285d1a9db10ba6c
https://docs.github.com/articles/closing-issues-via-commit-messages
7a116a8https://github.com/angular/angular-cli/commit/7a116a80d7e6db341fd003737285d1a9db10ba6c
angular-robothttps://github.com/angular-robot
on May 12, 2026https://github.com/angular/angular-cli/issues/33154#event-25444838380
fix(@angular/ssr): remove stateful flag from URL_PARAMETER_REGEXPhttps://github.com/angular-robot/angular-cli/commit/0fdcde5426c6b61a55f494077e71ecead08dd04d
https://docs.github.com/articles/closing-issues-via-commit-messages
0fdcde5https://github.com/angular-robot/angular-cli/commit/0fdcde5426c6b61a55f494077e71ecead08dd04d
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Jun 12, 2026https://github.com/angular/angular-cli/issues/33154#issuecomment-4686336530
automatic conversation locking policyhttps://github.com/angular/angular/blob/f0fbced1c55bc8b8ed9df01cea99df42f3e7eae3/contributing-docs/auto-issue-locking.md
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Jun 12, 2026https://github.com/angular/angular-cli/issues/33154#event-26652400870
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular-cli/issues/33154
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/33154
alan-agius4https://github.com/alan-agius4
area: @angular/ssrhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular%2Fssr%22
gemini-triagedLabel noting that an issue has been triaged by geminihttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22gemini-triaged%22
needsTriageNo due datehttps://github.com/angular/angular-cli/milestone/11
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.