I'm testing out vue-router's history mode on localhost development, and I'm getting an error when I try directly access the URL: http://localhost:8080/map/2
. When I get to the URL via a $router.push
of some kind, it behaves correctly. I'm wondering what may be causing this issue.
router/index.js
import Vue from "vue"
import Router from "vue-router"
const PublicMap = () => import("@/components/PublicMap/index.vue")
Vue.use(Router)
var routes = [
{
component: PublicMap,
name: "map",
path: "/map/:_id",
},
]
export default new Router({
routes,
mode:
"history"
})
Error:
Uncaught SyntaxError: Unexpected token <