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

Vue3: Exceptions thrown in data result in blank page #11807

Open
richard-cox opened this issue Sep 4, 2024 · 1 comment · May be fixed by #12198
Open

Vue3: Exceptions thrown in data result in blank page #11807

richard-cox opened this issue Sep 4, 2024 · 1 comment · May be fixed by #12198
Assignees
Labels
area/vue3 kind/bug QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this
Milestone

Comments

@richard-cox
Copy link
Member

richard-cox commented Sep 4, 2024

Setup

  • Rancher version: dev of 2.10.0

Describe the bug

  • Exception in data function breaks dashboard
  • Page shown contents no content at all
  • This is a regression from 2.9, exposing us to cases where exceptions are swallowed

To Reproduce

  • Artificially manufacture an error in a component's data function, for example
    • for example /shell/pages/home.vue
    • data() {
        throw new Error('sdfdsf');
      },
      
  • Visit dashboard home page

Result

  • Completely blank page

Expected Result

  • Basics of page rendered
  • image

Additional Information

  • Exceptions throw in the following behave the same as previously
    • fetch
    • computed property
    • created
@richard-cox richard-cox added this to the v2.10.0 milestone Sep 4, 2024
@github-actions github-actions bot added the QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this label Sep 4, 2024
@richard-cox richard-cox changed the title Exceptions thrown in data result in blank page Vue3: Exceptions thrown in data result in blank page Sep 4, 2024
@eva-vashkevich eva-vashkevich linked a pull request Oct 9, 2024 that will close this issue
7 tasks
@eva-vashkevich
Copy link
Member

We are pushing this issue out because it appears to be more complex than originally thought. A few discoveries:

  • Vue 3 doesn't seem to catch errors in data like Vue 2 did. Internal data handling is missing error handling which doesn't let us just carry on like Vue2 did.
  • vueApp.config.errorHandler is only configured for dev environment. This results in a blank page in production. We should add some error handling for non-dev setup.
  • Adding ErrorBound doesn't seem to catch the error, but it can be worked around by using try-catch inside data.
  • If you try to go to a page that throws error in data, it might cause a Vue error. This gets app in a weird state. We should come up with a repro and submit a bug report to Vue. Refreshing the page redirects the page to fail-whale like it should.
"[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core 
  at <Index class="outlet" onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 
  at <RouterView key="/c/_/manager/cloudCredential" class="outlet" > 
  at <Default onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy(Object) {_fetchDelay: 200, $fetch: ƒ, updatePageActions: ƒ, setCustomColor: ƒ, removeCustomColor: ƒ, …} > > 
  at <RouterView key=1 > 
  at <App>"

This can be reproduced by throwing an error inside data in 'shell/pages/c/_cluster/manager/cloudCredential/index.vue'

Some suggestions: #12198

@eva-vashkevich eva-vashkevich modified the milestones: v2.10.0, v2.11.0 Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vue3 kind/bug QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants