Search code examples
vue.jshttpvuejs2vue-router

Reload routes not working with Vue Router


I just finished to build my portfolio on Vue.js 2 and went live. I have three views. When I reload the home view it's ok but on the two other ones I have several error messages.

Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead. Work:30 A parser-blocking, cross site (i.e. different eTLD+1) script, No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://website.com' is therefore not allowed access. The response had HTTP status code 403.

It's the first time for me to go live with a single page webapp architecture. Any idea to fix this please?

Here is the router file:

import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home'
import Work from '@/views/Work'
import About from '@/views/About'

Vue.use(VueRouter)

export default new VueRouter({
  mode: 'history',
  routes: [
    { path: '/', component: Home },
    { path: '/Work', component: Work },
    { path: '/About', component: About }
  ]
})

Solution

  • Take a look at the example configurations on the Vue Router website. They often fix issues that happen server side when all is in dev.