Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Update layout.tsx to fix 404 not rendering #199

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Update layout.tsx to fix 404 not rendering #199

merged 1 commit into from
Sep 17, 2024

Conversation

acouch
Copy link
Member

@acouch acouch commented Sep 13, 2024

Summary

404 pages had the following issue:

image

This PR fixes that by adding the <html><body>... in the top level layout.

This error only appears in dev.

Time to review: 5 mins

Copy link

Coverage report for ./frontend

St.
Category Percentage Covered / Total
🟢 Statements 90.06% 707/785
🟡 Branches 71.33% 204/286
🟢 Functions 86.31% 145/168
🟢 Lines 90.75% 667/735

Test suite run success

155 tests passing in 47 suites.

Report generated by 🧪jest coverage report action from 8f00e99

@acouch acouch marked this pull request as ready for review September 17, 2024 13:02
Copy link
Member

@andycochran andycochran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

(This sent me down a rabbit hole trying to determine why basic HTML was missing. Can we reference best practices for NextJS layout/page/<head> scaffolding, maybe see how the Nava template or other projects are doing it?)

@acouch
Copy link
Member Author

acouch commented Sep 17, 2024

@andycochran great question. The root level layout is necessary, AFAICT, for the not-found.ts which doesn't work with next-intl unless it is at the root level. This is true for the examples provided by next-intl: https://github.com/amannn/next-intl/tree/2b363635db6542d726e6a4231bf1ac579fad7322/examples/example-app-router-playground/src/app, though I didn't see an issue in their repo for that specifically. When I tested it locally the 404 page doesn't work unless it is at the root level.

@acouch acouch merged commit 5f919a8 into main Sep 17, 2024
12 checks passed
@acouch acouch deleted the acouch/404-fix branch September 17, 2024 16:52
acouch added a commit to HHS/simpler-grants-gov that referenced this pull request Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants