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

improve full refresh overlay #33301

Merged
merged 3 commits into from Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/next/client/dev/error-overlay/hot-dev-client.js
Expand Up @@ -330,7 +330,12 @@ const FULL_REFRESH_STORAGE_KEY = '_has_warned_about_full_refresh'
function performFullRefresh(err) {
if (shouldWarnAboutFullRefresh()) {
sessionStorage.setItem(FULL_REFRESH_STORAGE_KEY, 'true')
onFullRefreshNeeded(err.message)
const reason =
err &&
((err.stack && err.stack.split('\n').slice(0, 5).join('\n')) ||
err.message ||
err + '')
onFullRefreshNeeded(reason)
} else {
window.location.reload()
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next/compiled/@next/react-dev-overlay/client.js

Large diffs are not rendered by default.

Expand Up @@ -109,7 +109,7 @@ const FullRefreshWarningReason = ({
component, which disables Fast Refresh. Fast Refresh requires at least
one parent function component in your React tree.
</p>
<p>You can find more information in the related Webpack error below:</p>
<p>You can find more information in the related error below:</p>
<Terminal content={reason} />
</>
)
Expand Down