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(vue-app): prevent looping on error during render of error page #6217

Merged
merged 4 commits into from
Sep 1, 2019

Conversation

pimlie
Copy link

@pimlie pimlie commented Aug 11, 2019

Follow up of: #4257
Resolves: #4140

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

The $forceUpdate cannot be called async with eg $nextTick as then the NuxtError component would still be rendered and trigger the infinite reloading.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@pimlie pimlie requested a review from a team August 11, 2019 20:37
@codecov-io
Copy link

codecov-io commented Aug 11, 2019

Codecov Report

Merging #6217 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##             dev   #6217   +/-   ##
=====================================
  Coverage   95.7%   95.7%           
=====================================
  Files         79      79           
  Lines       2652    2652           
  Branches     683     683           
=====================================
  Hits        2538    2538           
  Misses        98      98           
  Partials      16      16
Flag Coverage Δ
#e2e 100% <ø> (ø) ⬆️
#fixtures 50.56% <ø> (ø) ⬆️
#unit 92.3% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8ee9a6...9d4b8f3. Read the comment docs.

@nuxt nuxt deleted a comment from codecov-io Aug 12, 2019
@pimlie pimlie self-assigned this Aug 12, 2019
@pimlie
Copy link
Author

pimlie commented Aug 12, 2019

Just to make sure: could someone please confirm it is correct that navigation to /info renders nothing in the e2e test? When I test this manually with nuxt then in dev mode it returns an error page but with build/start it indeed returns nothing. If you then refresh the page it says server error.

test('/info prints empty page', async () => {
await page.nuxt.navigate('/info')

expect(await page.$text('#__layout')).toBe('')
Copy link
Author

Choose a reason for hiding this comment

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

Is this correct behaviour? In dev mode it returns an error page, with build/start it doesnt

Copy link
Member

Choose a reason for hiding this comment

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

Well it should displayed 'An error occured` error page I believe 🤔

Copy link
Author

@pimlie pimlie Aug 30, 2019

Choose a reason for hiding this comment

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

I checked with the dev branch and there the page is empty as well.

We could capture this error though as its being passed through errorCaptured. It just seems that by default in production there is no error handler so it just blanks out with an error in the console.

Copy link
Member

Choose a reason for hiding this comment

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

loading-indicator will go to a bad state in case of fatal errors and SPA mode. Otherwise, that blank screen is somehow unexpected.

@pi0 pi0 requested review from clarkdo, atinux, manniL and a team August 21, 2019 19:45
@pi0 pi0 changed the title fix: prevent looping on error during render of error page fix(vue-app): prevent looping on error during render of error page Aug 24, 2019
@pi0 pi0 requested a review from aldarund August 24, 2019 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error.vue infinite loop
7 participants