Skip to content

Commit

Permalink
fix: handle missing raw setup state
Browse files Browse the repository at this point in the history
When setup function returns render function there's no devtoolsRawSetupState and setupState is empty. When the same component exposes some data the loop will try to access it from the `raw` const. To prevent accessing property of undefined we'll default `raw` to an empty object.

fixes vuejs#2123
  • Loading branch information
bgoscinski committed Apr 2, 2024
1 parent 963ff7f commit cef3303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/app-backend-vue3/src/components/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function processState(instance) {
}

function processSetupState(instance) {
const raw = instance.devtoolsRawSetupState
const raw = instance.devtoolsRawSetupState || {}
const combinedSetupState = (Object.keys(instance.setupState).length
? instance.setupState
: instance.exposed
Expand Down

0 comments on commit cef3303

Please sign in to comment.