Replies: 6 comments
-
The problem is with the import: import { colors } from 'src/components/tokens.stylex'; You need to use relative paths to actual file. StyleX doesn't know about aliases set up in the import { colors } from '../tokens.stylex'; We're already working to add support for aliases to StyleX. Why is |
Beta Was this translation helpful? Give feedback.
-
I have used the relative path, still it is not working. Below is my Vite config file.
|
Beta Was this translation helpful? Give feedback.
-
@arunnan Also, can you try putting the |
Beta Was this translation helpful? Give feedback.
-
@nmn I've updated all my dependencies and moved stylex() before all the plugins, but I'm still facing the issue. |
Beta Was this translation helpful? Give feedback.
-
@arunnan It might also be useful to:
Other than that, share more details about your build setup if you want more help. |
Beta Was this translation helpful? Give feedback.
-
I'll explain why you can't make it works. Currently |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Created tokens.stylex.ts as below.
and Buttons.tsx as below
I am getting the below error
[plugin:vite-plugin-stylex] C:\Users\Arun\Documents\GitHub\black\packages\frontend\src\components\buttons\Button.tsx: Only static values are allowed inside of a stylex.create() call.
Kindly suggest a fix.
Beta Was this translation helpful? Give feedback.
All reactions