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.

Unable to use CSS Modules example from the website

See original GitHub issue

🐛 bug report

Basic example from the website appeared to be not working: CSS Modules can’t be used since no class names were exported.

🎛 Configuration (.babelrc, package.json, cli command)

No configuration. I installed Parcel using Yarn globally and used parcel index.html.

🤔 Expected Behavior

CSS class name available in JS.

😯 Current Behavior

classes.main from the snippet on the website is undefined.

💻 Code Sample

Files index.html, index.js, main.js, and main.css from https://parceljs.org/.

🌍 Your Environment

Software Version(s)
Parcel 1.6.1
Node 8.9.4
Yarn 1.3.2
NVM 0.27.1
Operating System macOS Sierra

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
davidnaglicommented, Feb 17, 2018

@alexeyraspopov I don’t think there are any plans to enable postcss modules by default because that would probably get in the way of people who don’t want any postcss in their projects. But it should be pretty simple now that all you have to do is add a .postcssrc

We probably should make the docs more clear, since your not the first person to run into this issue where you don’t realize you need to make a .postcssrc

5reactions
ColrBlndcommented, Jan 7, 2019

Parcel just works… unless you try to use something as basic as CSS

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to use css module in create-react-app - Stack Overflow
CSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'localIdentName'....
Read more >
Using CSS Module Scripts to import stylesheets - web.dev
Learn how to use CSS module scripts to import CSS stylesheets using the same syntax as JavaScript modules.
Read more >
How to configure CSS Modules for webpack - LogRocket Blog
Increase the flexibility of your app's CSS components with CSS Modules and Webpack in this handy tutorial and demo app build.
Read more >
How to configure CSS and CSS modules in webpack
One of the first thing you need to configure in your webpack project is CSS. CSS is so fundamental to a web app...
Read more >
Solving the React Error: Not Picking Up CSS Style | Pluralsight
Here, the CSS file is saved outside the src folder, so the compiler failed to import it. To make this code work, you...
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