Home

Issue: 133

export 'default' (imported as 'store') was not found in '~store/index.js'

[issue link]

Thank you for such a great tool!

I’m trying to use vuex store with module files, but am running into the error (v0.9.5):

export 'default' (imported as 'store') was not found in '~store/index.js'

My directory structure looks like:

|— layouts
|  |__ default.vue
|— pages
|  |__ index.vue
|  |__ admin.vue
|— store
|  |__ index.js
|  |__ admin.js

In my store/index.js, I’m trying to simply do:

export const state = { sidebar: false }
export const mutations = {}

And in layout/default.vue:

<template>
  <div>
    <navbar :show="true"/>
    <sidebar :show="$store.state.sidebar"></sidebar>
    <app-main/>
    <footerbar/>
  </div>
</template>

NOTE: I’ve tried using mapState to get the computed property sidebar as well, to no avail.

I’ve also copied the example code from your vuex-store-2, but get the same error.

Any thoughts or suggestions?

Thanks again!

This question is available on Nuxt.js community (#c110)