Unverified Commit 30ca6b38 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

improve full refresh overlay (#33301)

include a few lines of stack trace in the full refresh overlay
error is not necessary webpack related



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
parent fd231a68
...@@ -330,7 +330,12 @@ const FULL_REFRESH_STORAGE_KEY = '_has_warned_about_full_refresh' ...@@ -330,7 +330,12 @@ const FULL_REFRESH_STORAGE_KEY = '_has_warned_about_full_refresh'
function performFullRefresh(err) { function performFullRefresh(err) {
if (shouldWarnAboutFullRefresh()) { if (shouldWarnAboutFullRefresh()) {
sessionStorage.setItem(FULL_REFRESH_STORAGE_KEY, 'true') 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 { } else {
window.location.reload() window.location.reload()
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -109,7 +109,7 @@ const FullRefreshWarningReason = ({ ...@@ -109,7 +109,7 @@ const FullRefreshWarningReason = ({
component, which disables Fast Refresh. Fast Refresh requires at least component, which disables Fast Refresh. Fast Refresh requires at least
one parent function component in your React tree. one parent function component in your React tree.
</p> </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} /> <Terminal content={reason} />
</> </>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment