vue-slick-carousel icon indicating copy to clipboard operation
vue-slick-carousel copied to clipboard

SSR with responsive fails

Open milindsingh opened this issue 3 years ago • 8 comments

On mobile, the SSR content with 3 slides per page is rendered, which later changes to 1 with a flicker.

Anyone facing this?

milindsingh avatar Apr 01 '21 17:04 milindsingh

same problem

nbili avatar May 18 '21 15:05 nbili

use client-only run on client is work for me

nbili avatar May 21 '21 07:05 nbili

same problem, if put responsive to slickOptions, SSR breaks

any syggestions?

3em avatar Jun 10 '21 03:06 3em

I got same problem too! After research, i found a solution (in my case) Responsive failed if there are least one of the parrents has attribue "display: flex" => Remove and change to other will fix the problem

zappu9x avatar Sep 09 '21 09:09 zappu9x

We've had Client Side Hydration Errors when using responsive in combination with infinite.

On the Server Side as well as on "Desktop" more child element are being rendered than on a smaller resolution. Therefore when accessing the page with a Smartphone the app ran into an Hydration Error.

We "fixed" it by setting infinite to false and extending our responsive config to set centerMode based on the resolution like so:

[
      {
        breakpoint: 1024,
        settings: {
          slidesToShow: 2,
          centerMode: false,
        },
      },
      {
        breakpoint: 600,
        settings: {
          slidesToShow: 1,
          centerMode: true,
        },
      },
    ]

ma-jahn avatar Sep 21 '21 13:09 ma-jahn

This works for me as well <client-only>

tcblaize avatar Jul 13 '22 14:07 tcblaize

Is there no SSR-friendly fix for this? Using <client-only> means the contents will not be there when the page initially loads. Not good for SEO.

technogize avatar Dec 15 '22 12:12 technogize

I implemented a solution in this PR on my forked repo: vue-slick-carousel-rtl. Also works well with ltr mode.

Iran-110 avatar Sep 21 '23 00:09 Iran-110