Skip to content

Vue3 Property "_isVue" was accessed during render on Reactive preferences #631

Description

@Blakeinstein

Describe the bug
When updating a reactive preference, the change is not reflected. The console contains warning containing the above error.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a vue3 project (I am using vite-cli -> vue + typescript)
  2. Install vue-preferences then create a reactive preference
  3. Update the preference.
  4. See console

Expected behavior
The value should have reactively updated without requiring a refresh.

Error

runtime-core.esm-bundler.js:38 [Vue warn]: Property "_isVue" was accessed during render but is not defined on instance. 
  at <Content> 
  at <App>
warn @ runtime-core.esm-bundler.js:38
get @ runtime-core.esm-bundler.js:6877
s.J @ preference-object.js:58
s.get @ preference-object.js:36
get @ preference.js:12
reactiveEffect @ reactivity.esm-bundler.js:42
get value @ reactivity.esm-bundler.js:876
get @ runtime-core.esm-bundler.js:3090
_sfc_render @ Content.vue:2

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Webview2 [edge]
  • "vue": "^3.0.5",
    "vue-preferences": "^3.0.0"
    

Additional context
Here is what my code approx looks like, but I get the error on almost all instances of updating preference. To reflect the changes elsewhere. I need a full reload.

<button round @click="theme = theme == 'dark' ? 'light' : 'dark'">

<script>
computed: {
  theme: preference('activeTheme', { defaultValue: 'dark' })
}
</script>

I also tried the programmatic approach but the value doesnt update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions