question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Css module support is broken in 3.1.3

See original GitHub issue

In 3.1.2 docs example works, imports in js return correct objects.

postcss({
  modules: true
})

In 3.1.3 same code imports return undefined. From https://github.com/egoist/rollup-plugin-postcss/pull/292 there is new onlyModules option I believe. Using it brings back correct objects.

postcss({
  modules: true,
  onlyModules: false
})

However, it’s a breaking change, this option is not documented and I have no idea if using it is a correct workaround.

Would be awesome to see official solution to this one 🙏

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
song-jiacommented, Jul 28, 2020

I’ve same issue, set autoModules: false resolve my problem. My settings:

postcss({
    modules: {
        generateScopedName: 'myapp_[name]_[local]'
    },
    extract: true,
    autoModules: false
})
2reactions
slavafomincommented, Feb 5, 2021

Wow, it almost broke our release, good thing that tests caught this.

After upgrading to 4.0.0 our styles stopped being processed as CSS modules therefore returning undefined to JS and emitting stylesheets without properly rewritten classnames. Setting autoModules to false helped it. By the way, we are not using .module in our filenames.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A complete guide to CSS Modules in React (Part-1) - codeburst
What if everything was running great and one day you decided to import a 3rd party library and everything broke due to CSS...
Read more >
Internet explorer 11 & webpack V3 - doesn't bundle css ...
I'm working on a React\Redux project, bundled with webpack. After upgrading webpack V1 to V3, IE (11) support is broken, some of the...
Read more >
Upgrade Guide - Tailwind CSS
Note that Tailwind CSS v3.0 requires PostCSS 8, and no longer supports PostCSS 7. ... module.exports = { purge: [ content: [ //...
Read more >
css-loader | Yarn - Package Manager
css -loader. owner webpack-contrib95mMIT6.7.3 vulns 0 vulnerabilities. css loader module for webpack. webpack, css, loader, url ...
Read more >
CSS Modules & Sass in Create React App | by Kirsten Swanson
json file and look how many dependencies you have! We're going to be adding some more to support the preprocessing of Sass (.scss...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found