Giter VIP home page Giter VIP logo

Comments (10)

BuffaloBuffalo avatar BuffaloBuffalo commented on July 24, 2024 2

As an alternative, it'd be great to have a way to suppress the style tag injection entirely and instead import the css into a webpack bundle.

from nuka-carousel.

sompylasar avatar sompylasar commented on July 24, 2024

As an alternative, it'd be great to have a way to suppress the style tag injection entirely and instead import the css into a webpack bundle.

Yes. Because, as I found out recently, scoped styles aren't supported in most browsers.

from nuka-carousel.

otajor avatar otajor commented on July 24, 2024

@sompylasar @BuffaloBuffalo Did either of you find a workaround for this? It's the only thing that's messing up my server-side rendering :(

from nuka-carousel.

sompylasar avatar sompylasar commented on July 24, 2024

@otajor There is no viable workaround for this, only change the library code. But the issue is with the HTML validation by the W3C Validator. How is it messing up the server-side rendering? Could you elaborate please? Maybe it's a different issue you're talking about.

from nuka-carousel.

otajor avatar otajor commented on July 24, 2024

@sompylasar I was getting the following error on my server-rendered pages (only the ones with carousels on):
uncaught Error: Unable to find element with ID 173

I googled and found this SO answer which said it was caused by invalid HTML structure. So when I saw this thread I figured it was the cause of my bug.

Seems I was right as I seem to have fixed the problem by adding a hacky .replace(/<style/g, '<style scoped') to my rendered html on the server before serving it. I'll see if I can come up with something less dangerous though!

from nuka-carousel.

sompylasar avatar sompylasar commented on July 24, 2024

@otajor Interesting... Just checked. I don't get this error while still having <style type="text/css" data-reactid="507">.slider-slide > img {width: 100%; display: block;}</style> rendered by the server-side.

from nuka-carousel.

sompylasar avatar sompylasar commented on July 24, 2024

@otajor Which browser are you observing the error in?

from nuka-carousel.

otajor avatar otajor commented on July 24, 2024

@sompylasar Chrome 58 - nothing fancy! And nuka-carousel 2.0.4.

from nuka-carousel.

sompylasar avatar sompylasar commented on July 24, 2024

@otajor I'm sticking with 1.2.0 but I don't see any clear difference in this part.

from nuka-carousel.

sompylasar avatar sompylasar commented on July 24, 2024

@otajor Maybe it's React? I use 15.5.4.

from nuka-carousel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.