vue3-router-template
vue3-router-template copied to clipboard
vue 3 issue
I was trying to learn vue router with version 3 and I am getting this error:
const routerHistory = createWebHistory()
Object(...) is not a function.
So I guess its not recognizing this createWebHistory as the console as a X in that line.
There is a difference in my package.json from yours:
"dependencies": { "core-js": "^3.6.5", "vue": "^3.0.0-0", "vue-router": "^3.4.3" }, "devDependencies": { "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-service": "~4.5.0", "@vue/compiler-sfc": "^3.0.0-0", "babel-eslint": "^10.1.0", "eslint": "^6.7.2", "eslint-plugin-vue": "^7.0.0-0", },
Do you know why and how to get rid of this error?
I guess its the vue-router version. I just created a new project manually and added the router during installation and its showing version 4.0 and the router is working as well by default.. Thanks.