Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

fix: [Vue warn]: toRefs() expects a reactive object but received a plain one. #555

Closed
thisVioletHydra opened this issue Sep 17, 2021 · 5 comments
Assignees
Labels
bug Something isn't working needs-repro Waiting for code that can reproduce the issue

Comments

@thisVioletHydra
Copy link

thisVioletHydra commented Sep 17, 2021

๐Ÿ› The bug
What isn't working? Describe what the bug is.

๐Ÿ› ๏ธ To reproduce
Steps to reproduce the behavior:

run nuxt
add https://pinia.esm.dev/ssr/nuxt.html
import store like

<!-- SCRIPT -->
<script lang="ts">
  import { defineComponent } from '@nuxtjs/composition-api'; 
  import { useStore } from "~/store/main";

  export default defineComponent({
    name: 'Count',
    props: {},
     setup() {
        const store = useStore();
        return { store };
    }
  });
</script>
<!-- - โšก - -->

store:

import { defineStore } from 'pinia';

export const useStore = defineStore('companiesInfo', {
  state: () => ({
    data: {test: 1},
  }),
});

I'd be very grateful for a link to a gist or repo that reproduces the bug.

๐ŸŒˆ Expected behaviour
What did you expect to happen? Is there a section in the docs about this?

โ„น๏ธ Additional context
pinia issues
vuejs/pinia#648

@thisVioletHydra thisVioletHydra added the bug Something isn't working label Sep 17, 2021
@danielroe
Copy link
Member

@thisVioletHydra Would you provide a reproduction via https://template.nuxtjs.org ? ๐Ÿ™

@danielroe danielroe added the needs-repro Waiting for code that can reproduce the issue label Sep 17, 2021
@thisVioletHydra
Copy link
Author

@thisVioletHydra Would you provide a reproduction via https://template.nuxtjs.org ? ๐Ÿ™

okay no problem

@thisVioletHydra
Copy link
Author

@thisVioletHydra Would you provide a reproduction via https://template.nuxtjs.org ? ๐Ÿ™

https://codesandbox.io/s/weathered-bird-l4kww?file=/components/Test.vue
push refresh page
image
image

@thisVioletHydra
Copy link
Author

@danielroe any news ?

@posva
Copy link

posva commented Oct 1, 2021

The error comes from vuejs/composition-api#821

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs-repro Waiting for code that can reproduce the issue
Projects
None yet
Development

No branches or pull requests

3 participants