Skip to content
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 not working with mq-layout #32

Open
SnooHD opened this issue Feb 26, 2019 · 5 comments
Open

SSR not working with mq-layout #32

SnooHD opened this issue Feb 26, 2019 · 5 comments

Comments

@SnooHD
Copy link

SnooHD commented Feb 26, 2019

Good day,
I'm using ssr for my project, and if im using
<mq-layout mq="mobile">
it renders <mq-layout> instead of a div and ignores the breakpoint.

When im using <div v-if="$mq === 'mobile'> it works as intented.
This only happens while using SSR.

@Bergrebell
Copy link

same here. also when using <div v-if="$mq === 'mobile'> i get an error saying that Property or method "$mq" is not defined on the instance but referenced during render.

@1shaked
Copy link

1shaked commented May 31, 2021

When I am using <div v-if="$mq === 'mobile'> I ma getting _vue.runtime.esm.js:619 [Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render._
not sure what to do; I am using Nuxt version 2.2 and Vue-MQ version 1.0.1. Every time I am adding v-if for $mq, an error occurs.

@SnooHD
Copy link
Author

SnooHD commented May 31, 2021

@1shaked give it a go with https://github.com/vanhoofmaarten/nuxt-mq ;)

@1shaked
Copy link

1shaked commented May 31, 2021

I tried this library which causes the same issue; I tried moving away from it with vue-MQ

@acacha
Copy link

acacha commented Nov 16, 2022

Responsive design and SSR is complex. Please read: https://nitayneeman.com/posts/combining-server-side-rendering-and-responsive-design-using-react/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants