title: vue2 and composition api - cannot import store, error [vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function
body: <p>I am using vue 2.6.14 and <a href="https://github.com/vuejs/composition-api" rel="nofollow noreferrer">composition-api</a> 1.3.3 package to use composition api. I have</p>
  <p>my main.js like</p>
  <pre class="lang-js prettyprint-override"><code>import Vue from 'vue'
  import VueCompositionAPI from '@vue/composition-api'
  Vue.use(VueCompositionAPI) 
  import App from './App.vue'
  import router from './router' 
  Vue.config.productionTip = false 
  new Vue({
    router,
    render: h =&gt; h(App)
  }).$mount('#app')
  </code></pre>
  <p>I try to setup a store</p>
  <p>I have a <code>src folder / store folder / index.js </code></p>
  <p>and inside the <code>index.js</code></p>
  <pre class="lang-js prettyprint-override"><code>import { reactive } from '@vue/composition-api'  
  
  const state = reactive({
      counter : 0
  })
  
  export default{ state }
  </code></pre>
  <p>inside <code>App.vue</code> I try to import store to use it</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script&gt;  
  import store from '@/store'  
  &lt;/script&gt;
  </code></pre>
  <p>I get the error <code>Uncaught Error: [vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function.</code></p>
  <p>I tried all solutions from <a href="https://stackoverflow.com/questions/61885716/uncaught-error-vue-composition-api-must-call-vue-useplugin-before-using-any">here</a> and nothing works. If I remove the <code>import store from '@/store'</code> the error goes away. Using vue 3 s not an option.</p>
  <p>How can I solve this?</p>
  <p>Thanks</p>