Skip to content

How to make styled-components work with Vite during production build? #4098

Discussion options

You must be logged in to vote

I solved it. It wasn't a issue with Vite. Somehow doing a CSS @import inside styled component caused that and removing it solved it. I also had issue while deploying to netlify which mentioned [vite]: Rollup failed to resolve import "react-is" from "node_modules/styled-components/dist/styled-components.browser.esm.js". and I fixed that one by setting node & npm versions in netlify to latest.

Replies: 6 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@AskAlice
Comment options

@jonasmarco
Comment options

@julioalucero
Comment options

@danielpza
Comment options

@Amadeo-Frontend
Comment options

Answer selected by silenceofthewans
Comment options

You must be logged in to vote
1 reply
@silenceofthewans
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet