Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gatsby should have consistent route resolution for development and production #550

Closed
Algram opened this issue Nov 11, 2016 · 5 comments
Closed
Labels
help wanted Issue with a clear description that the community can help with.

Comments

@Algram
Copy link
Contributor

Algram commented Nov 11, 2016

Currently Gatsby resolves a fake "404"-Route, but only in development. The user gets confused by this as one might think this route will also show in production. That will never happen though, because the server won't find the page and therefore it wil return a real 404 status code.

My suggestion would be to remove this fake 404 page from development mode and instead show a proper error, since a link to a non-existant page is a proper error.

Here are two images from my blog to show you what I am talking about:

Development
development-404

Production:
production-404

@KyleAMathews KyleAMathews added DX help wanted Issue with a clear description that the community can help with. labels Nov 14, 2016
@KyleAMathews
Copy link
Contributor

Big 👍 to this! The development environment and production environment should be as consistent as possible so the current behavior is definitely wrong. Thanks for bringing this up!

This would be an easy first PR for someone — in the development server we have a list of all the pages

return globPages(directory, (err, pages) => {
. Basically check against that when loading a page and return the 404 page if the page doesn't exist.

@vinnymac
Copy link
Contributor

@Algram @KyleAMathews is this not dependent on server routing configuration? The 404 page loads the same for both development and production on my blog.

See production here

Also @KyleAMathews you propose changing the develop.js file to return a 404 page, but in the example above @Algram shows the 404 page loading just fine for development. What behavior does your recommended change create?

@radubrehar
Copy link

Has anyone started some work on this? Or can I offer to try & fix it?

@KyleAMathews
Copy link
Contributor

Please do!

@jbolda jbolda added v0 labels Jun 5, 2017
@KyleAMathews
Copy link
Contributor

I think this was fixed? Comment or reopen if there's still trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with.
Projects
None yet
Development

No branches or pull requests

5 participants