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

Gatsby-plugin-sass no longer imports module styles as of 4.0.1 #30037

Closed
shennan opened this issue Mar 5, 2021 · 4 comments · Fixed by #30038
Closed

Gatsby-plugin-sass no longer imports module styles as of 4.0.1 #30037

shennan opened this issue Mar 5, 2021 · 4 comments · Fixed by #30038
Assignees
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@shennan
Copy link

shennan commented Mar 5, 2021

Description

Gatsby sass css modules broken in V3. I have read the migration and implemented the new import syntax. When importing sass css modules á la:

import * as styles from './SomeStyles.module.scss'

console.log(styles)

/*

Output:
{
  Symbol(Symbol.toStringTag): "Module"
  __esModule: true
  __proto__: Object
}
*/

There is effectively an empty Module in the output, with no style key/values even if the SomeStyles.module.scss has valid styles. I believe this as a result of the update to the Gatsby Sass Plugin that was pushed a few days ago, as returning to gatsby-plugin-sass version 4.0.0 (not 4.0.1) seems to fix issue.

Steps to reproduce

Very easy to produce with a Gatsby starter and a simple *.module.scss file imported.

For ease, here's a temporary repo:

https://github.com/shennan/repro-gatsby-broken-sass-plugin

Expected result

You should see key/values representing styles in the styles object after importing.

Actual result

The styles object is empty, bar some inherited properties.

Environment

  System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.20.2 - ~/.nvm/versions/node/v12.20.2/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.11 - ~/.nvm/versions/node/v12.20.2/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 88.0.4324.192
    Firefox: 69.0.1
    Safari: 14.0.3
  npmPackages:
    gatsby: ^3.0.1 => 3.0.2
    gatsby-plugin-sass: ^4.0.1 => 4.0.1
  npmGlobalPackages:
    gatsby-cli: 3.0.0
@shennan shennan added the type: bug An issue or pull request relating to a bug in Gatsby label Mar 5, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 5, 2021
@wardpeet wardpeet self-assigned this Mar 5, 2021
@wardpeet
Copy link
Contributor

wardpeet commented Mar 5, 2021

@shennan We made a boo boo in gatsby-plugin-sass@3.0.1, if you revert to version 3.0.0, this goes away. I have a patch up.

@wardpeet wardpeet added status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 5, 2021
@shennan
Copy link
Author

shennan commented Mar 5, 2021

@wardpeet Do you mean 4.0.1? 🤔

@pieh
Copy link
Contributor

pieh commented Mar 5, 2021

@shennan Ops, Yeah - regression introduced in 4.0.1 - but reverting to 4.0.0 helps - we will be reverting offender ( #30038 ), but in meantime downgrading 1 patch version can get you unblocked

@vladar
Copy link
Contributor

vladar commented Mar 5, 2021

Published in gatsby-plugin-sass@4.0.2

AbhyudayaSharma added a commit to AbhyudayaSharma/abhyudayasharma.github.io that referenced this issue Mar 6, 2021
Remove unneeded configuration. See gatsbyjs/gatsby#30037
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants