-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
CSS not loaded #778
Comments
My bad, correct import is: |
Thanks, that was helpful. Why |
pretty helpful thanks @jalanga |
Actually helped me after much pundering |
./src/index.js Search for the keywords to learn more about each error. i am getting this error while importing .how to fix this . |
Are you using react js?
Sent from Yahoo Mail on Android
On Fri, Feb 22, 2019 at 2:10 PM, Dilip Kumar<notifications@github.com> wrote:
./src/index.js
Line 3: Unexpected '!' in '!style-loader!css-loader!bootstrap/dist/css/bootstrap.css'. Do not use import syntax to configure webpack loaders import/no-webpack-loader-syntax
Search for the keywords to learn more about each error.
i am getting this error while importing .how to fix this .
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I fixed my css issues with a code..in the package json file.. Am not with my pc now. I will forward it later if you need.
Sent from Yahoo Mail on Android
On Sat, Feb 23, 2019 at 2:31 AM, Chinonson Enam Ibeh<enamibeh@yahoo.com> wrote: Are you using react js?
Sent from Yahoo Mail on Android
On Fri, Feb 22, 2019 at 2:10 PM, Dilip Kumar<notifications@github.com> wrote:
./src/index.js
Line 3: Unexpected '!' in '!style-loader!css-loader!bootstrap/dist/css/bootstrap.css'. Do not use import syntax to configure webpack loaders import/no-webpack-loader-syntax
Search for the keywords to learn more about each error.
i am getting this error while importing .how to fix this .
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Having same issues as @youngheart12 , am a beginner in react and the accepted answered above is using an old config file from webpack |
There is nothing special or reactstrap specific for importing CSS (such as bootstrap's CSS). The issue that @youngheart12 and @drindc24 are running into is that they have a project which specific forbids using inline loaders. An inline loader is a modification to the import statement to make the import be a non-standard import. It adds which loader you want to use when loading the file to the file name string. import 'bootstrap/dist/css/bootstrap.css'; this is a webpack specific import which webpack understands import '!style-loader!css-loader!bootstrap/dist/css/bootstrap.css'; The problem with the webpack specific import is that you are coupling your imports to a specific build tool (which is considered bad practice). |
Example:
|
@mkalish For some reason when I ran a build the CSS was loss. I decided to import the bootrap css to my top level app component. Thanks this helped! |
Issue description
5.0.0-alpha.4
16.2.0
4.0.0-beta.3
What is happening?
I am importing the button, I am rendering it, I can see the button but the style is not applied. The css is imported I can see it, but is not applied to the button
I am using it inside electron.
My dependencies:
Code:
Imported css in index.js as:
import 'bootstrap/dist/css/bootstrap.css';
The text was updated successfully, but these errors were encountered: