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 SSR error handling in the global scope #3877

Merged
merged 6 commits into from
Feb 24, 2018
Merged

Conversation

arunoda
Copy link
Contributor

@arunoda arunoda commented Feb 23, 2018

Fixes #3864

  • - Implement the fix
  • - Add a test case

@arunoda arunoda changed the title Fix SSR error handling in the global scope [WIP] Fix SSR error handling in the global scope Feb 23, 2018
@arunoda arunoda changed the title [WIP] Fix SSR error handling in the global scope Fix SSR error handling in the global scope Feb 24, 2018
try {
return require(pagePath)
} catch (err) {
throw pageNotFoundError(page)
console.error(err)
Copy link
Member

Choose a reason for hiding this comment

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

This should be under the MODULE_NOT_FOUND check, because otherwise every page that doesn't exist will be shot into the console. This includes things like favicon.ico and robots.txt in development.

@arunoda arunoda merged commit 77c8677 into canary Feb 24, 2018
@arunoda arunoda deleted the fix-runtime-error-handling branch February 24, 2018 13:19
@majelbstoat
Copy link

Thank you!

@lock lock bot locked as resolved and limited conversation to collaborators Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dev swallowing errors and showing 404 instead, since 5.0.1-canary.5
3 participants