I am currently in the process of developing a Vuejs application and I have encountered an issue with adding Vuex store.
Here is the code snippet that is causing trouble:
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
userData: "USER!"
},
mutations: {
},
actions: {
},
getters: {
}
})
export default store
An error message keeps popping up:
Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=52de2cee' does not provide an export named 'default'
main.js
import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router'
const app = createApp(App)
import Vuex from 'vuex'
import { store } from '@/store/users'
app.use(router)
app.use(Vuex)
app.mount('#app')
I need help to identify what went wrong. Thank you for your assistance.