You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue with Next.js 14.0.4 when using Stylex. The error message I'm receiving is:
Error ...src/app/common/components/ui/Card/index.js: Only static values are allowed inside of a stylex.create() call.
Folder Structure:
As you can see above I have my globalToken.stylex.js file directly under the app folder. Its contents mirror those of the globalToken.stylex.ts file in the next-js-example folder.
Code Snippets:
Here is the content of my CardTokens.stylex.js file:
This is not a relative import and so it won't work at the moment. Use ../, i.e. a relative path to make it work. If that fixes the issue, it's a duplicate of #40 as mentioned by @nedjulius.
Problem Description:
I am encountering an issue with Next.js 14.0.4 when using Stylex. The error message I'm receiving is:
Folder Structure:
As you can see above I have my globalToken.stylex.js file directly under the app folder. Its contents mirror those of the globalToken.stylex.ts file in the next-js-example folder.
Code Snippets:
Here is the content of my CardTokens.stylex.js file:
And the relevant section in the Card/index.js file:
Issue:
The error disappears when I comment out the line:
Is the issue related to globalToken not being a relative import? This seems unlikely as all values used are static, and nothing is dynamic.
I would greatly appreciate any insights or assistance in resolving this issue. Thank you for your time and help.
The text was updated successfully, but these errors were encountered: