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

Docs SSR #834

Merged
merged 16 commits into from
Dec 9, 2019
Prev Previous commit
Next Next commit
Replace 404 on lost connect with Location.reload()
iAdramelk committed Dec 6, 2019
commit e43940d812a20b2c7094d10f5dc423e398fdf8e5
6 changes: 2 additions & 4 deletions pages/doc.js
Original file line number Diff line number Diff line change
@@ -152,10 +152,8 @@ Documentation.getInitialProps = async ({ asPath, req }) => {
headings: parseHeadings(text),
markdown: text
}
} catch (e) {
return {
errorCode: 404
}
} catch {
window.location.reload()
Comment on lines +160 to +161
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't this go into an infinite loop? (Blocked by the browser probably.)

Continuation of #834 (review)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If page loads again then yes, but this error usually means that the internet is down and we will just show browser error page there. Maybe there are cases then this error is thrown in other situations, but I don't know about them.

}
}