vuejs / composition-api

Composition API plugin for Vue 2
https://composition-api.vuejs.org/
MIT License
4.19k stars 343 forks source link

The setup binding property "XYZ" is already declared. #960

Closed AkashJeedigunta closed 2 years ago

AkashJeedigunta commented 2 years ago

Hi I have a project that runs on Vue 2 and will be moved to Vue 3 soon, Before that, I have a POC to check and learn how this vue-composition API works. So the setup and all went really well and no functional issues for the component.

However, I keep getting The setup binding property "XYZ" is already declared for all the data variables that were initialized and are returned at the end of the setup(). If I don't return{} they are not referenced.

Please if anyone can help me fix the issue.

Here is the basic snippet I initially started

import {
    ref,
    reactive,
} from "@vue/composition-api";

export default {
  setup() {
      const isLoading = ref(false);
      const user = ref('Akash');
  }

  return{
      isLoading,
      user
  }

}
</script>
AkashJeedigunta commented 2 years ago

I figured that I have the same component that is being loaded in multiple places so are the errors. Have to figure out how to resolve it. Hence closing this issue