-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
SSR compatibility #243
Comments
Apparently Vue Material could be updated to work with SSR |
This will be developed for the next version. Also I would love to see a PR with this fix. :D |
@marcosmoura - why is it not working with ssr? Some info and I may attempt a pull request. Been trying to use it with nuxt.js but debugging from there is somewhat hard. |
Well. Right now the API rely on "window" and "document" to be rendered. I will need to change every single component to make it work. |
@marcosmoura |
Hi @ram-you The only problem with the SSR solution, to be developed, is the large amount of testing and adaptations to the codebase. That's why I postponed it, because I already had a lot of features ready to be released and the SSR feature was holding them. I will try to prioritize this to be on 0.7.0. |
Thank you Marcos. I am confident that this will attract many more users. Because most of those who have migrated to Vue.js is mainly for server-side rendering. Thank you again and good luck. |
Hi @marcosmoura, Out of curiosity I checked out this repo to get an idea of what would be involved in making it SSR compatible. Besides the document and window global variables being undefined, the following 2 dependencies are not SSR compatible:
I reckon the cleanest approach would be to split server and browser builds and shim window methods such as setTimeout in the render path to execute without a delay for SSR. |
One thing to mention here as I saw this in another issue on |
Yeah. There is some points that should be fixed in order to make the SSR support to work. |
Looking forward to the release of this feature. Finished an entire project after switching from Angular 2 thinking that everything is already in place for SSR, but am just waiting now for ssr in vue-material. Nice work on the components though, I must say it was very intuitive to use. Just thought I would also share a workaround fix that we used on another component to get ssr working, since the component is mostly for animating when a user does a certain event, there was no need to really render it besides its' data on SSR, and thus we just by past the code that used window. Since most of vue-material is also mostly just modifying what is where and how, could it be a simple fix to by pass anything that any ways won't matter on the server? For example scroll events, since no scrolling is taking place on the server anyways. |
Hello. Any news on that matter? Also trying to get it work with NUXT. Both are GREAT projects, would be happy if they play well together. |
+1 for compatibility with nuxt |
Just inform about the current situation. I try use it today and get this error: Vue.js error
ReferenceError: document is not defined
at Object.defineProperty.value (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:9:11279)
at e (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:6:369)
at Object.<anonymous> (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:10:18827)
at e (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:6:369)
at Object.t.__esModule.default (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:7:5309)
at e (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:6:369)
at Object.o (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:7:386)
at e (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:6:369)
at Object.<anonymous> (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:11:14365)
at e (D:\Develop\fb-scaner\node_modules\vue-material\dist\vue-material.js:6:369) I already dream about the release of version 0.8 and the support of the SSR |
I'm in the same position. I'm starting a new nuxt.js project and I'm going to have to use vuetifyjs instead of vue-material due to the lack of SSR support |
Same here, have to chose vuetify over vue material due to lack of ssr |
I have nuxt.js and use vue-material with this code (nuxt plugin):
But waiting for SSR 👍 |
@drozdzynski this code is not working. How did you set this up? |
@jerakode I wrote it in march, so now this is able to not work, I stop working with this library, so I don't know how to make it work now. |
@drozdzynski cool, ok. Any advice what framework works nice with Nuxt, beside Vuetify? I am so struggling right now with that. |
@jerakode what's wrong with Vuetify? |
@sebastianmacias |
@ram-you same as |
@sebastianmacias I don't need 600kb of Vuetify just to use 2-3 component. It's too opinionated. I have my own base, I just need few interactive UI elements. I tried to integrate mdc, but it's so stupidly build, so I drop it. |
@dohomi so, basicaly, vue-material is not working fine with Nuxt, right? |
@jerakode please check the source: https://github.com/vuetifyjs/vuetify/blob/master/dist/vuetify.min.js
|
The blank original vuetify/nuxt starter weights over 700kb. When clean Nuxt starter in approx 150kb. Haven't tried gzip tho. |
I tried out a solution, that seems to work. I'm not sure if it's good or a bad :-) , what do you think? My vue-material nuxt plugin: if (!process.BROWSER_BUILD) { var Vue = require('vue') |
Hey @marcosmoura, any plans to release it? |
Yep. I know. The new version is coming. With SSR Support. Finally! |
@felipekm |
Yeah @ram-you same feeling here, anyway I will wait for few days. |
Any kind of help will be appreciated. I will create a roadmap this week for
you guys follow the progress.
|
@ram-you you forget to mention, that it could be late for you, but not the others. |
@iamdubx Me too! :P |
@iamdubx of course for me. Never late for the community. |
Same here |
Enhanced SSR Support is in 1.0.0-beta5! |
When i use a mdbutton with nuxt i get a |
@christophwolff its weird because mdButton doesnt have any document in code |
Any update on this? |
@Awais-cb Try to use it as a non SSR Nuxt plugin. Should work then. |
thanks for your response chris will try as you suggested i have just one more question to ask will it effect my site's ranking for seo? |
Hey @marcosmoura and team, I'm integrating Vue Material with Nuxt (which uses SSR) as per their
plugins
instructions and get[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content.
so I created an issue over there if you want to have a look - might be good for both projects - nuxt/nuxt#76The text was updated successfully, but these errors were encountered: