question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NotFoundPage incorrectly gives 200 status error instead of 404

See original GitHub issue

Because Redwood is a single-page app, the built-in 404-page web/src/pages/NotFoundPage/NotFoundPage.js is handled by WebPack as a “normal” page, i.e. it’s optimized and becomes a part of the dist/static/js/…chunk.js files during build. This can/could be problematic because it results in a 200 http status code for the 404 page and it also requires JS.

This seems like a good opportunity to take a step forward with Redwood pre-rendering! The goal would be to build NotFoundPage as a separate, static asset. Likely there are other solutions that would work (possible that WebPack already has a config option). But if there’s a way to learn and step toward Redwood having pre-render capability, I suggest that be the preferred option.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

4reactions
simoncryptacommented, Sep 2, 2021

Same for GraphQL, I think the web don’t care about HTTP code anymore 😅 image

2reactions
thedavidpricecommented, Feb 1, 2022

Per Core Team Discussion:

  • bump this as a priority to post-v1; will be incorporated with SSR solution
Read more comments on GitHub >

github_iconTop Results From Across the Web

php - 404 error page showing HTTP Status 200 instead of 404
You need to place the header function for 404 on the "404_error" page instead of the page that redirects. This because the browser...
Read more >
How to Fix the 404 Page Not Found Error In WordPress
Creating Your Own Error 404 Not Found Page on WordPress ... the visitor's web browser will receive a 200 HTTP status code from...
Read more >
404 Pages Should Not Return 200 Status Codes
404 Pages Should Not Return 200 Status Codes ... "Page Not Found" web pages return a 200 header status code, instead of a...
Read more >
The Ultimate Guide To 404, 410, and Soft 404 Errors
The default HTTP status response code for non-error pages is a 200, which means this page is “Okay”. If the default response code...
Read more >
get custom not found page to return 404 status code
... to get Umbraco to return a "proper" 404 status code instead of 200 ... the custom 404 page throws a 404 status,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found