Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): handle HTTP requests to assets du…
Browse files Browse the repository at this point in the history
…ring SSG in dev-server

This commit fixes an issue were during SSG/SSR in the dev-server http requests to assets causes the page rendering to fail.

(cherry picked from commit 8178c23)
  • Loading branch information
alan-agius4 committed Oct 26, 2023
1 parent e68a662 commit 19191e3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,11 @@ export async function setupServer(
}

transformIndexHtmlAndAddHeaders(url, rawHtml, res, next, async (html) => {
const protocol = serverOptions.ssl ? 'https' : 'http';
const route = `${protocol}://${req.headers.host}${req.originalUrl}`;
const { content } = await renderPage({
document: html,
route: pathnameWithoutServePath(url, serverOptions),
route,
serverContext: 'ssr',
loadBundle: (path: string) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down

0 comments on commit 19191e3

Please sign in to comment.