Skip to content

Commit

Permalink
pass original locals to the 404 page render
Browse files Browse the repository at this point in the history
  • Loading branch information
AirBorne04 committed Jan 8, 2025
1 parent 3caa337 commit e3f40ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/famous-gorillas-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

use same request context for initial request also for 404 page renders (e.g. runtime from adapters)
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-astro-server/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export async function handleRoute({
const fourOhFourRoute = await matchRoute('/404', manifestData, pipeline);
if (fourOhFourRoute) {
renderContext = await RenderContext.create({
locals: {},
locals,
pipeline,
pathname,
middleware: isDefaultPrerendered404(fourOhFourRoute.route) ? undefined : middleware,
Expand Down

0 comments on commit e3f40ea

Please sign in to comment.