Title: Router: NoMatch escapes route recognition on Safari 17.6 and the navigation never settles · Issue #71038 · angular/angular · GitHub
Open Graph Title: Router: NoMatch escapes route recognition on Safari 17.6 and the navigation never settles · Issue #71038 · angular/angular
X Title: Router: NoMatch escapes route recognition on Safari 17.6 and the navigation never settles · Issue #71038 · angular/angular
Description: Deliver web apps with confidence 🚀. Contribute to angular/angular development by creating an account on GitHub.
Open Graph Description: Deliver web apps with confidence 🚀. Contribute to angular/angular development by creating an account on GitHub.
X Description: Deliver web apps with confidence 🚀. Contribute to angular/angular development by creating an account on GitHub.
Opengraph URL: https://github.com/angular/angular
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Router: NoMatch escapes route recognition on Safari 17.6 and the navigation never settles","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nrouter\n\n### Is this a regression?\n\nNo\n\n### Description\n\nIn production, Safari 17.6 users sporadically click a link and the navigation neither completes nor fails: no `NavigationEnd`, no `NavigationError`, and the promise returned by `router.navigate()` never settles. Instead, the app's `ErrorHandler` receives the router's internal `NoMatch` (empty message, `segmentGroup` property) through `NgZone.onError`, reported by zone.js as an unhandled rejection.\n\nThe app uses zone.js 0.15.1 with `provideZoneChangeDetection()` and is built with `@angular/build`, so async/await is lowered to generators with esbuild's `__async` helper. Mapped against the production chunks, the stack reads:\n\n| Frame | Code |\n|---|---|\n| `t@chunk-FFUPTH3R.js:1:38159` | `NoMatch` constructor |\n| `@chunk-FFUPTH3R.js:1:45633` | `throw new NoMatch(rawSegment)` in `Recognizer.matchSegmentAgainstRoute` |\n| `next@[native code]` | generator resume |\n| `o@chunk-KFP6Q3NT.js:1:1425` | esbuild `__async` step: `o = f => { try { i(c.next(f)) } catch (j) { e(j) } }` |\n| `@polyfills.js:2:562` | zone.js wrapper of a `then` callback, whose `catch` rejects the chained promise |\n\nOur reading:\n\n1. The generator of `matchSegmentAgainstRoute` resumes after `await firstValueFrom(matchWithChecks(…))` and throws `NoMatch`, as designed.\n2. The `try/catch` in `o` does not catch it, although it surrounds the `c.next(f)` call that threw. JavaScript semantics rule this out, so we suspect a defect in Safari 17.6's JavaScriptCore.\n3. zone.js catches the exception in its `then` wrapper, rejects the promise from `Promise.resolve(value).then(o, p)`, which nobody observes, and reports it as an unhandled rejection. zone.js 0.15 passes the original value on.\n4. The promise of `matchSegmentAgainstRoute` never settles, so `processSegment` waits forever and the navigation hangs until the next navigation supersedes it.\n\nIt shows in the router because the recognizer signals \"this route does not match\" by throwing `NoMatch` and catching it in `processSegment`. With many sibling routes in named outlets (126 children in our case), one navigation throws up to about 70 exceptions through async functions, by far the most in the application. The failure mode depends on the recognize stage using async/await (#62994). #70900 mentions `NoMatch` and `AbsoluteRedirect` escaping in production; this may be the same thing.\n\n**Suggestion:** signal \"no match\" with a return value instead of an exception. For example, `processSegmentAgainstRoute` and `matchSegmentAgainstRoute` could resolve to a sentinel that `processSegment` checks before it tries the next route. That takes the exception flow through async/await out of every navigation, whatever the engine does, and saves creating dozens of `Error` objects with stack traces per navigation.\n\n### Please provide a link to a minimal reproduction of the bug\n\nNot reproduced outside Safari 17.6 yet, see \"Anything else?\".\n\n### Please provide the exception or error you saw\n\n```true\nError\n t@https://\u003chost>/chunk-FFUPTH3R.js:1:38159\n @https://\u003chost>/chunk-FFUPTH3R.js:1:45633\n next@[native code]\n o@https://\u003chost>/chunk-KFP6Q3NT.js:1:1425\n onInvoke@https://\u003chost>/chunk-GR63O44E.js:4:19837\n run@https://\u003chost>/polyfills-P23JZYKH.js:1:7847\n @https://\u003chost>/polyfills-P23JZYKH.js:2:562\n onInvokeTask@https://\u003chost>/chunk-GR63O44E.js:4:19655\n runTask@https://\u003chost>/polyfills-P23JZYKH.js:1:8496\n Y@https://\u003chost>/polyfills-P23JZYKH.js:1:15714\n invokeTask@https://\u003chost>/polyfills-P23JZYKH.js:1:14763\n\nUser agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Safari/605.1.15\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\n@angular/core, @angular/router: 21.2.12\n@angular/build, @angular/cli: 21.2.10\nzone.js: 0.15.1\nTypeScript: 5.9\nBrowser: Safari 17.6 (macOS)\n\nAngular CLI : 21.2.10\nAngular : 21.2.12\nNode.js : 24.16.0\nPackage Manager : npm 11.13.0\nOperating System : win32 x64\n\n┌──────────────────────────────────┬───────────────────┬───────────────────┐\n│ Package │ Installed Version │ Requested Version │\n├──────────────────────────────────┼───────────────────┼───────────────────┤\n│ @angular/build │ 21.2.10 │ ^21.2.10 │\n│ @angular/cdk │ 21.2.10 │ ^21.2.10 │\n│ @angular/cli │ 21.2.10 │ ^21.2.10 │\n│ @angular/common │ 21.2.12 │ ^21.2.12 │\n│ @angular/compiler │ 21.2.12 │ ^21.2.12 │\n│ @angular/compiler-cli │ 21.2.12 │ ^21.2.12 │\n│ @angular/core │ 21.2.12 │ ^21.2.12 │\n│ @angular/elements │ 21.2.12 │ ^21.2.12 │\n│ @angular/forms │ 21.2.12 │ ^21.2.12 │\n│ @angular/language-service │ 21.2.12 │ ^21.2.12 │\n│ @angular/localize │ 21.2.12 │ ^21.2.12 │\n│ @angular/material │ 21.2.10 │ ^21.2.10 │\n│ @angular/material-moment-adapter │ 21.2.10 │ ^21.2.10 │\n│ @angular/platform-browser │ 21.2.12 │ ^21.2.12 │\n│ @angular/router │ 21.2.12 │ ^21.2.12 │\n│ rxjs │ 7.8.2 │ ^7.8.2 │\n│ typescript │ 5.9.3 │ ^5.9.2 │\n│ zone.js │ 0.15.1 │ ^0.15.0 │\n└──────────────────────────────────┴───────────────────┴───────────────────┘\n```\n\n### Anything else?\n\nReproduction attempts: the production chunks, run against our route configuration in JavaScriptCore via Bun 1.0.0 to 1.3.5 (20,000 to 40,000 recognitions each, plain and inside NgZone, with aggressive JIT settings), never failed. In the field the failures are sporadic and sit between successful navigations to the same URLs.\n\nWorkaround in our app, in case it helps others: the `ErrorHandler` recognizes the escaped `NoMatch` (`'segmentGroup' in error`) and restarts `router.currentNavigation()` while its `finalUrl` is unset, in a `setTimeout` because zone.js reports unhandled rejections after draining the microtask queue. We also moved the most used routes to the front of each outlet to cut the number of `NoMatch` exceptions per navigation.","author":{"url":"https://github.com/MilesAl","@type":"Person","name":"MilesAl"},"datePublished":"2026-09-29T11:52:09Z","url":"https://github.com/angular/angular/issues/71038"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:74bcbd74-114f-2c94-37a4-e352dc7a59bd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FC8:2FDEEB:2FB55E:3E3A18:6B06164B |
| html-safe-nonce | 79621b10db520eb4a65f26fff134b5d180d910f0e6f5f7253ba762230c07598b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkM4OjJGREVFQjoyRkI1NUU6M0UzQTE4OjZCMDYxNjRCIiwidmlzaXRvcl9pZCI6IjIzOTcyNjI5ODMzMzc0ODE4MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9529b320cb80b6953b33926ba994251be5e306dda3afc07a296f9065f85c69ad |
| hovercard-subject-tag | repository:24195339 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular/issues/71038 |
| twitter:image | https://repository-images.githubusercontent.com/24195339/d4194dc2-d880-43f7-960c-ea30e05c6531 |
| twitter:card | summary_large_image |
| og:image | https://repository-images.githubusercontent.com/24195339/d4194dc2-d880-43f7-960c-ea30e05c6531 |
| og:image:alt | Deliver web apps with confidence 🚀. Contribute to angular/angular development by creating an account on GitHub. |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-cache |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width