Giter Site home page Giter Site logo

Comments (8)

TheSharpieOne avatar TheSharpieOne commented on June 18, 2024

You will need a style loader and css loader for webpack to be able to import css like that. Docs for importing styles/css can be found at https://webpack.github.io/docs/stylesheets.html.

Alternatively, you can use <link href="https://unpkg.com/[email protected]/style.css"> in your html to pull the styles resource from a CDN. Using a CDN means you would not need to import the style in your code. Note the version in the URL and make sure it matches your version. If you updated the version of this library you are using, you will need to make sure to update the version in the URL as well.

Update: react-block-ui is now on cdnjs: https://cdnjs.com/libraries/react-block-ui You can grab the css from there and even a minified version of the css as well as the SRI links.

from react-block-ui.

TheSharpieOne avatar TheSharpieOne commented on June 18, 2024

@hhh146578 did the comment above address your issue?

from react-block-ui.

TheSharpieOne avatar TheSharpieOne commented on June 18, 2024

I'm closing this issue as it is inactive. If the issue is unresolved, please comment and I will reopen.

from react-block-ui.

gautambt avatar gautambt commented on June 18, 2024

I am getting the same error while trying to use react-block-ui with webpack on rails. I've tried to use style.min.js as recommended above with no luck (The minified file has the comment as well). The default webpack config for rails does come with style loader enabled by default. and I am able to import other css files fine. If I remove the comment "" in style.css everything works fine.

from react-block-ui.

TheSharpieOne avatar TheSharpieOne commented on June 18, 2024

There is no style.min.js just a style.css. If your webpack config is only looking for javascript files then you need to either adjust your configuration or include the styles from the cdn.
I would recommend also using create-react-app as it comes out of the box with css import capabilities.

from react-block-ui.

gautambt avatar gautambt commented on June 18, 2024

The issue is probably not with webpack config as I am able to load other css files from js files just fine. I am able to import and use the library fine if I remove the comment <!-- CSS Animations --> on line 51. The syntax for commenting in css files is /* Css Animations */.

from react-block-ui.

TheSharpieOne avatar TheSharpieOne commented on June 18, 2024

I fixed that comment syntax and will release it when I get to a computer.

from react-block-ui.

TheSharpieOne avatar TheSharpieOne commented on June 18, 2024

@gautambt v1.1.1 has the fix. Please give it a try.

from react-block-ui.

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.