CSS not loaded
See original GitHub issueIssue description
- components: Button
- reactstrap version
5.0.0-alpha.4
- react version
16.2.0
- bootstrap version
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:
"animated": "^0.2.0",
"auto-launch": "^5.0.1",
"bootstrap": "^4.0.0-beta.3",
"classnames": "^2.2.5",
"devtron": "^1.4.0",
"electron-debug": "^1.2.0",
"electron-store": "^1.2.0",
"electron-sudo": "^4.0.12",
"history": "^4.6.3",
"lodash": "^4.17.4",
"mdi": "^2.0.46",
"prop-types": "^15.5.10",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-google-maps": "^9.4.5",
"react-hot-loader": "3.1.3",
"react-jss": "^7.0.2",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.6",
"react-transition-group": "^2.2.0",
"reactstrap": "^5.0.0-alpha.4",
"recompose": "^0.26.0",
"redux": "^3.7.2",
"redux-form": "^7.2.0",
"redux-saga": "^0.16.0",
"redux-thunk": "^2.2.0",
"semantic-ui-flag": "^2.2.11",
"source-map-support": "^0.5.0",
"sudo-prompt": "^7.1.1",
"warning": "^3.0.0",
"winston": "^2.3.1"
Code:
// @flow
import React from 'react';
import { ConnectedRouter } from 'react-router-redux';
import { Container, Button } from 'reactstrap';
type RootType = {
store: Object,
history: Object
};
export default function Root({ store, history }: RootType) {
return (
<Container>
<Button color="primary">primary</Button>
</Container>
);
}
Imported css in index.js as:
import 'bootstrap/dist/css/bootstrap.css';
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:12 (2 by maintainers)
Top Results From Across the Web
HTML not loading CSS file - Stack Overflow
HTML not loading CSS file · Are both files in the same directory? · Which browser are you using? have you already checked...
Read more >How to Troubleshoot CSS Not Working - WPForms
In this tutorial, we'll walk through options to troubleshoot why your CSS is not working and offer possible solutions. Browser Caching.
Read more >Why Is My Site Not Loading the CSS File in 2022? - WPCity.com
A site may not load the CSS file due to browser caching. It's the most common cause and is the easiest to fix...
Read more >How to fix CSS not linking to your HTML document
How to fix CSS not linking to your HTML document · Make sure that you add the rel attribute to the link tag...
Read more >How to Fix CSS file is not Working with HTML in Chrome
Fix CSS file is not Working with HTML in Chrome | Problem Solved Show SupportBuy Me a COFFEE: https://buymeacoffee.com/Webjahin ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My bad, correct import is:
import '!style-loader!css-loader!bootstrap/dist/css/bootstrap.css';
Thanks, that was helpful. Why
import
'!style-loader!css-loader!bootstrap/dist/css/bootstrap.css';
is work, but in the official documentation isimport 'bootstrap/dist/css/bootstrap.css';
which is not working? The answer is that it’s need a correct loader in webpack.config.js:{ test: /\.css$/, loader: 'style-loader!css-loader' },