Redirect breaks server rendering #7718
Labels
help wanted
Issue with a clear description that the community can help with.
status: confirmed
Issue with steps to reproduce the bug that’s been verified by at least one reviewer.
type: bug
An issue or pull request relating to a bug in Gatsby
Description
Gatsby does not handle @reach/router's
<Redirect>
component when server rendering, resulting in a build error on sites that use<Redirect>
. The current workaround is to use thenoThrow
prop on the redirect.The fix is to use @reach/router's
isRedirect
method to check errors instatic-entry.js
.Importing
isRedirect
and replacing this block with something like:Should fix the issue.
Steps to reproduce
yarn
yarn run build
See related PR for workaround: gatsbyjs/store.gatsbyjs.org#111
Expected result
The site should build
Actual result
The site build fails with errors.
Environment
The text was updated successfully, but these errors were encountered: