Reputation:
I try using vuex with Vue3 and Vite. After installing it with yarn like yarn add vuex@next --save
I get the error:
The requested module '/vite-dev/@fs/home/app/node_modules/.vite/vuex.js?v=f336efac' does not provide an export named 'createStore'
Any idea how to solve this?
EDIT:
store.js
import { createStore } from 'vuex'
...
const store = createStore({
plugins: [createPersistedState()],
state() {
return {...},
main.js - just importing store file
import { store } from "./store.js";
Upvotes: 1
Views: 1320
Reputation:
I got it solved by deleting node_modules
and re-installing the dependencies. Not sure why that solved it tho.
Upvotes: 2