-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue+Meteor SSR calling the client-side component lifecycle hooks beforeMount()
and mounted()
on the server-side
#409
Labels
Comments
same |
Any updates regarding this issue? |
I've managed to fix this issue in my own project. The main idea is to prevent the Vue instance from mounting on the server, by removing the el property from the Vue object on the server-side, then mount the Vue instance manually client side
import Vue from 'vue';
// Meteor Tracker integration
import VueMeteorTracker from 'vue-meteor-tracker'
Vue.use(VueMeteorTracker)
import App from './ui/App.vue'
import router from './router'
function createApp () {
return {
app: new Vue({
// el: '#app', <= REMOVE THIS
router,
...App,
}),
router,
}
}
export default createApp;
import { Meteor } from 'meteor/meteor'
import CreateApp from './app'
Meteor.startup(() => {
CreateApp().app.$mount('#app');
}) You can test this on my vue-meteor-boilerplate |
ismail9k
pushed a commit
to ismail9k/vue-meteor
that referenced
this issue
Oct 16, 2020
To overcome the vue-ssr and vue-meta issues (closes meteor-vue#409)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Greetings, @Akryum.
Problem
Vue+Meteor SSR calling the client-side component lifecycle hooks on the server-side:
beforeMount()
;mounted()
.This results in breaking other packages from the Vue ecosystem, as example:
vue-meta@>=2.3.4
is broken, see: Fix: 500 error using Vue+Meteor SSR after updatevue-meta
version to 2.3.4 nuxt/vue-meta#569.How to reproduce
Best wishes,
Sergey.
The text was updated successfully, but these errors were encountered: