Error: Failed to parse declaration "transform"
See original GitHub issueI was trying tailwind-rn 4.0.0 and had a build issue Error: Failed to parse declaration “transform: translate(var(–tw-translate-x), var(–tw-translate-y)) rotate(var(–tw-rotate)) skewX(var(–tw-skew-x)) skewY(var(–tw-skew-y)) scaleX(var(–tw-scale-x)) scaleY(var(–tw-scale-y))”
Comparing to previous version, v4.0.0 doesn’t omit unsupported styles which causes error in css-to-react-native
lib.
Did you experience this issue before?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Failed to parse declaration "transform: translate(0, 100%)" #3
It seems this package doesn't handle css transforms properly. I get the error shown in the title when using css transforms.
Read more >Failed to parse declaration "background: url(1) : using styled ...
I'm new to react native and I'm trying to use the "Imagebackground" using styled-components but I get an error on android when I...
Read more >Using Styled Components with React Native - Level Up Coding
Styled Components is a CSS-in-JS library that enables developers to write each component with their own styles and allows the code to be...
Read more >How to fix: CSS: Parse Error. - Rocket Validator
CSS styles could not be parsed, check the indicated line to find what caused the parser to fail. Common causes are unclosed curly...
Read more >babel/parser
The Babel parser (previously Babylon) is a JavaScript parser used in Babel. The latest ECMAScript version enabled by default (ES2020). Comment attachment.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Disabling the properties that are not supported worked for me. Add this to your tailwind config
I dont use these classes, but the css was still being generated. This should perhaps be added to the readme?
I see what’s happening here. Tailwind’s JIT compiler finds that
transform
is mentioned in your source code (instyles
object), so it thinks that you’re using thetransform
utility when you clearly don’t. Thentailwind-rn
fails to parse it, which causes this error.@HeleneGrini’s fix is nice, I think I should include it in the readme instructions as well as
setup-tailwind-rn
CLI. Going to open this issue until it’s resolved. Thanks Helene!