title: How to handle Uncaught Error: [nuxt] store/index.js should export a method that returns a Vuex instance
body: <p>I have setup a default store in <a href="https://nuxtjs.org/" rel="nofollow noreferrer">Nuxt</a> in <code>store/index.js</code> as the <a href="https://nuxtjs.org/docs/2.x/directory-structure/store" rel="nofollow noreferrer">documentation</a> recommends. When I try to render my app I'm getting the following error:</p>
  <blockquote>
  <p>Uncaught Error: [nuxt] store/index.js should export a method that
  returns a Vuex instance.</p>
  </blockquote>
  <p>My <code>store/index.js</code> file looks like this:</p>
  <pre><code>import Vuex from 'vuex'
  import Vue from 'vue'
  import myModule from './myModule'
  
  Vue.use(Vuex)
  
  const store = new Vuex.Store({
    state: () =&gt; ({
  
    }),
    mutations: {},
    actions: {},
    modules: {
      myModule: myModule
    }
  })
  export default store
  </code></pre>
  <p>How do I handle this?</p>