-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Importing components from node_modules which use CSS is not working #2469
Comments
I'm also having this issue while trying to use React Spectrum |
#830 relevant discussion about React Spectrum + CSS issue |
I work on React Spectrum. I think Remix needs to add support for CSS imports within node_modules. Nothing fancy, the CSS just needs to end up on the page as a side effect (ala webpack style-loader, etc.), or end up bundled alongside the JS (like Parcel, or webpack with mini-css-extract-plugin, CRA, Gatsby, etc.). Next.js has a similar issue, and has an RFC open to solve it: vercel/next.js#27953. Currently you can manually configure Next.js to solve it, but not sure if something similar is possible with Remix. If so, we'd be happy to add something to our docs. Otherwise, I think there's nothing we can really do until Remix adds support for this. CSS imports in node_modules are a pretty common and widely supported way to distribute CSS with JS libraries, so I imagine we're not the only library affected by this. |
I think the biggest blocker in adopting Remix is the styling issue. |
Any update on this? |
We have an ongoing discussion here about css modules: #4631 |
This is now on our roadmap, I'm currently looking into it: #4817 |
Implemented in Remix 1.11.0 🎉 |
I am still facing issue with this |
Remix 2.6.0 and still facing this issue. |
Did you find a solution for this? I am experiencing the same issue with |
Please checkout https://github.com/react18-tools/turborepo-template/. It might be what you are looking for. |
Adding the following to
|
What version of Remix are you using?
1.3.2
Steps to Reproduce
npm install uikit-test-using-css
(project only created to demonstrate the issue)import { Button } from "uikit-test-using-css"
and use<Button/>
in JSXExpected Behavior
The imported CSS file is handled as an asset and added to the bundle dependencies. In this demonstration it does not even rely on CSS modules. It's just a plain asset which has to be copied/hashed to the output folder and loaded by the application.
Actual Behavior
It crashes with a parse error:
While importing
.css
files works locally inside the actual application I am unable to import from our pre-made set of components which make use of CSS modules. Is there any chance to fix or to tweak the build system to take care?The text was updated successfully, but these errors were encountered: