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

fix: don't use EnsureResources for development 404 page #10625

Merged
merged 1 commit into from
Dec 24, 2018

Conversation

Sekhmet
Copy link
Contributor

@Sekhmet Sekhmet commented Dec 22, 2018

Description

After PR #10224 EnsureResources throws if there are no resources available for a route. It won't throw if there is custom 404 page (in that case hasResources will return true as it will load a 404 page resource).

This PR checks if custom 404 page exists and if it doesn't EnsureResources won't be used (there isn't anything to load). If we hit 404 page and custom 404 page exists we continue using EnsureResources to make sure it loads properly.

Related Issues

Fixes #10534
Fixes #10645

@Sekhmet Sekhmet requested a review from vtenfys December 22, 2018 15:35
@Sekhmet Sekhmet requested a review from a team as a code owner December 22, 2018 15:35
Copy link
Contributor

@vtenfys vtenfys left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@vtenfys vtenfys changed the title fix: don't use EnsureResources for default 404 page fix: don't use EnsureResources for development 404 page Dec 23, 2018
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

Thanks @Sekhmet!

@pieh pieh merged commit f6e2e65 into gatsbyjs:master Dec 24, 2018
@Sekhmet Sekhmet deleted the s-dev-404 branch December 24, 2018 22:13
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this pull request Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants