Skip to content

Commit

Permalink
fix(@angular/build): prevent errors with parameterized routes when `g…
Browse files Browse the repository at this point in the history
…etPrerenderParams` is undefined

Ensure that parameterized routes do not cause errors when the `getPrerenderParams` function is undefined, specifically in cases where the routing API is not utilized.

Closes #28948

(cherry picked from commit c685c70)
  • Loading branch information
alan-agius4 authored and clydin committed Nov 25, 2024
1 parent d8cbf3b commit c497749
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function extractRoutes(): Promise<RoutersExtractorWorkerResult> {
const { routeTree, appShellRoute, errors } = await extractRoutesAndCreateRouteTree(
serverURL,
undefined /** manifest */,
true /** invokeGetPrerenderParams */,
outputMode !== undefined /** invokeGetPrerenderParams */,
outputMode === OutputMode.Server /** includePrerenderFallbackRoutes */,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export default async function () {
path: 'lazy-two',
loadComponent: () => import('./lazy-two/lazy-two.component').then(c => c.LazyTwoComponent),
},
{
path: ':param',
component: OneComponent,
},
];
`,
);
Expand Down

0 comments on commit c497749

Please sign in to comment.