Open mizzao opened 6 years ago
I see why this won't work: https://github.com/meteor-vue/vue-meteor/blob/master/packages/vue-router2/package.js#L26
Is there any reason to include akryum:vue-router2
in a SSR app then? Or is there is a good way to load it on the client side and not on the server, and have things work properly?
Ended up just using vue-router
directly in my CreateApp
function:
import './plugins'
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
import App from './ui/App.vue'
function CreateApp () {
const router = new VueRouter({
mode: 'history',
routes,
})
return {
app: new Vue({
el: 'app',
router,
...App,
}),
router
}
}
export default CreateApp
Seems like the only thing this breaks is the foo.routes.js
file, but I've just converted that to the standard format instead. Would I be missing anything else?
When trying to run the following code in a Meteor+Vue SSR app:
I get the following error on the server:
It seems like the import is failing. Is this still the right way to use vue-router in a Meteor app? I noticed the demo app installs vue-router directly from npm. Do we even need to use
akryum:vue-router2
anymore?