Skip to content
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

Styles missing on production for SASS + CSS Module with gatsby-plugin-sass #4477

Closed
linmic opened this issue Mar 11, 2018 · 3 comments
Closed

Comments

@linmic
Copy link

linmic commented Mar 11, 2018

Description

SASS + CSS Module cause issues on production build, part of styles are missing to be exact.

Steps to reproduce

  1. Use gatsby new test to create a new project.
  2. Add gatsby-plugin-sass and add it to gatsby-config.js.
  3. Create styles.module.scss under src/components/Header with a simple .red { color: red; } within.
  4. In src/components/Header/index.js, import styles from './styles.module.scss, and use it anywhere you want.
  5. gatsby build then serve public

Expected result

Styles from layouts is missing from generated inline styles within <style id="gatsby-inlined-css">.
e.g. Styles for <body> should exist.

Actual result

It's gone.

Environment

  • Gatsby version: 1.9.231
  • gatsby-cli version: 1.1.45
  • Node.js version: 8.9.4
  • Operating System: macOS High Sierra

Minimum Reproducible Case

https://github.com/linmic/gatsby-module-issue

@linmic linmic changed the title Styles missing on production for SASS + CSS Module Styles missing on production for SASS + CSS Module with gatsby-plugin-sass Mar 12, 2018
@linmic
Copy link
Author

linmic commented Mar 12, 2018

Replacing gatsby-plugin-sass with gatsby-plugin-postcss-sass seems works.

@chrisk2020
Copy link

There is an issue with a recent update of gatsby-plugin-sass the plugin author is looking into it A temporary solution is to specify the version of gatsby-plugin-sass #4457

@erquhart
Copy link
Contributor

Fixed in #4495.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants