$q is undefined if rendered on a node js server without quasar-cli. Any help is highly appriciated.
-
Hey everyone,
I would like to ask for some direction. I have been actively using quasar for the past 1.5 years, and I absolutely love it. At the moment I am building a Meteor application, which uses Quasar for UI but without the CLI.
I am trying to setup SSR and render the site on the server. I initilaize the Vue object on the server like normally:
function createApp() { const router = createRouter(); const store = createStore(); const i18n = createI18n(); const app = new Vue({ router, i18n, store, render: h => h(Root) }).$mount('#app'); sync(store, router); return { app, router }; }
But the $q on the vue instance is undefined, i checked with debugger. And this causes multiple errors on the mapp, firstly that the Q-layout throws an error “TypeError: Cannot read property ‘screen’ of undefined”, but the Screen plugin is widely used in the application as well, removing these would not be a small task.
Anyone has any idea on how to go solving this? Is there any material i can read to better understand on how to render quasar properly on a node js server? Any help, direciton is highly appriciated.
-
At the moment I am building a Meteor application…
Big fan of Meteor here. As a side note, did you know you can also use Quasar CLI to create Meteor / Quasar apps.( instead of using the Meteor CLI like you do). I used this starter kit:
https://github.com/alexandesigner/quasar-meteor
Maybe this article will help:
https://dev.to/quasar/quasar-ssr-using-cookies-with-other-libs-services-4nkl -
@dobbel Thanks for the info. Same here, I have worked with Python, Java (and obviously node) before, and meteor + vue is by far my favourite stack. And quasar is just freaking top tier compared to anything i’ve used previously.
On the quasar discord I have been recommended the same, to separate the frontend out of meteor and use the quasar cli. While it is possible, it might take quite a long time to do so because of the size of the current project (next ones, for sure). Do you have any idea why is that when i call Vue.use(Quasar) on the server, then I create the app the $q is undefined on the Vue instance? This is the root of all the errors i am encountering (I believe)
-
Do you have any idea why is that when i call Vue.use(Quasar) on the server,
Sorry I have only experience with Quasar CLI mode apps.