CSS Loading Issue in development
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes
Which terms did you search for in User Guide?
CSS bundling for development
Environment
node -v: v9.2.1npm -v: 5.5.1yarn --version(if you use Yarn):npm ls react-scripts(if you haven’t ejected): [email protected]
Then, specify:
- Operating system: macOS Sierra
- Browser and version (if relevant): Firefox & Chrome
Steps to Reproduce
- Fork https://github.com/Ethan-Arrowood/cookie-jar/tree/feature/home-page
- Run
npm run set-up - Run
npm run start-serverin one terminal - Run
npm run start-clientin another terminal - Open the dev tools of the browser you are in and select the
<Home />element. The<div className='container'>'s styles will not appear in the inspector; however, its children styles will.
Expected Behavior
I expect the .container css rules to be loaded onto my page like the rest of the styles defined in Home.css during development.
Actual Behavior
It appears that only the .container { } rule is being omitted, not even loaded into the bundle.
Home.css

Inspected div.container

Inspected div.header

Reproducible Demo
https://cookie-jar-staging-pr-4.herokuapp.com/
This is a heroku build of this project. Does not reflect the develop environment issues I'm having as the build bundle does include the CSS and it appears in the editor. (Ignore styling behavior, I know it is broken in the deploy).
I guess its worth summarizing:
CSS works when built and deployed. some CSS does not work during development, when served from a local server.
Whats exceptionally strange is that this some CSS is literally in the same file as other CSS being loaded into the app. There is nothing wrong with the CSS as it renders correctly when built and deployed. I've tried renaming the className to other strings like: 'box' and 'abc'. I don't have any style libraries being loaded into the project.
Writing the CSS inline works! (But I'm trying to keep all CSS in stylesheets so this is not considered a solution)

On the demo you linked, I can verify that the class abc is defined and assigned to the container wrapping header, body and footer in Chrome and Firefox.


Having same issue.. looking for update on this conversation.
+1
I have the same issue as well. it really slows down my coding. maybe it's a webpack cache issue?
If someone has a workaround until this problem is solved, that will be great.
Thanks!
Can you please see if this exists with the 2.0 beta?
$ npm install react-scripts@next
Thanks!
Hmm - tried installed latest react-script - nothing.
It appears the css that is being added into the head is abruptly ending.
In my case I am loading tailwind.css, and when I look at the CSS file I import './index.css', it looks fine, but the the css added to the head is not including everything - just seems to stop abruptly:

I've kept playing with this..
So I'm wondering if there is a length issue of the