-
Notifications
You must be signed in to change notification settings - Fork 10.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
Postcss plugin applied inconsistently #8503
Comments
@ukch Your configuration of |
@kakadiadarpan I can confirm that changing the |
@ukch can you provide a reproduction repo for this? That would make it much simpler to diagnose this issue. |
@kakadiadarpan Unfortunately not at the moment, but I can confirm the issue seems to happen most often whenever I add a new second-level CSS block while the development server is running. |
@kakadiadarpan I can confirm, I'm having the same issue. Here's the repo: https://github.com/AgtLucas/gatsby-postcss-issue/ |
@kakadiadarpan Here's an example that is reproducing this error:
import React from "react";
import styles from "../css/modules/header-test.module.css";
export default props => (
<header class={styles.myHeader}>
<h1>This should be blue</h1>
</header>
);
.my-header {
padding: 65px 0;
} To reproduce:
.my-header {
padding: 65px 0;
& > h1 {
color: blue;
}
}
Expected: the heading text should be blue Actual:
.header-test-module--my-header--2sUuC {
padding: 65px 0;
& > h1 { color: blue;
}: ;
}
|
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m Thanks again for being part of the Gatsby community! |
Leaving a comment for those who like myself came here looking for answers. This is not an issue with the latest versions. Upgrade as necessity and time dictate. Happy coding! |
Description
I have
gatsby-plugin-postcss
installed. I am using apostcss.config.js
to manage my postCSS config. Gatsby sometimes uses the plugin to compile my CSS, and sometimes does not (I can tell when it does not because it does not understand my nested CSS rules). This happens during both develop and build stages.Often during development, my CSS will suddenly break and I need to restart the server - normally, restarting the server fixes my problem.
Steps to reproduce
npm install gatsby-plugin-postcss postcss-import postcss-preset-env
gatsby-config.js
:postcss.config.js
:index.js
, and rungatsby develop
.Expected result
e.g. the link colour should be pink
Actual result
e.g. the link colour is green. Inspecting the CSS shows the nesting still in place, which the browser does not understand.
Environment
Because of #8502 I am unable to post the output of
gatsby info
, but here are some details:The text was updated successfully, but these errors were encountered: