-
Notifications
You must be signed in to change notification settings - Fork 128
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
Styles not being applied on a clean install #2559
Comments
I also followed the guide and the button didn't display. Has this problem been resolved? |
Seeing the same issue. Fresh expo react native app with no changes and follow the gluestack-ui guide both using CLI and manually and styles don't display. |
I am experiencing the same issue in my Next.js project and also try to applying Tailwind utility classes to the button, there is no effect on its style. |
Hey @mithun-si , @JackGrantham @gaofc, Can you please share repo? and also which OS you are using |
I'm using Windows |
I'm using Windows too. |
https://codesandbox.io/p/devbox/playaround-hpfszq this is the my code sandbox link I think that you can get idea from there and also for your information I am using |
I'm seeing the same issue in an Expo project. The components work but no styling is applied. |
Hey everyone! We've released an updated version of the CLI with bug fixes to address the reported issues. Let us know if you face any issues while using it. |
Hi @vaibhk20, I am created fresh Next.js project and then install the latest gluestack-ui with this command "npx gluestack-ui@latest init" and try to used Button component but still the style is not applied Next.js version: 14.2.16 |
Hey @mithun-si, Please add |
I am still seeing the same issue. Here are the steps I am taking:
I also have tried adding "jsxImportSource": "nativewind" to my tsconfig file and this did not change anything for me. I am using Windows 11 Here is my code: |
Hey @JackGrantham, I have created a PR with all the fixes. Seems like cli is not working properly on windows. |
Hey @ryanmitchell, Can you checkout this PR and try to make same changes to it for more detailed guide please have look at nativewind docs. |
Yeah thanks. I got it working by copying over the configs from the starter kit app. |
Thanks @Viraj-10 your changes worked. However, I did need to downgrade to Node v20 from v22 since I was running into issues with 'require' not being defined in some imports in tailwind.config.js and metro.config.js |
Does this also work with nativewind 4.1.23? |
Hey @Viraj-10 , After adding this "jsxImportSource": "nativewind" to mytsconfig file now I can use tailwindcss it's work thanks but the default behavior still not working for example
it should show a button with some outline right? but my case I only see the Hello World! text nothing else Next.js: 14.2.16 |
@mathis-kdio, We are releasing support for v4.1 this week. |
@mithun-si please check your content property in |
Thanks @Viraj-10 it's working now but for action="primary"/"secondary" the color is not shown why? is there anything else need to add to show color I am using gluestack-ui CLI also when I am building my Next.js application there is a lot's of type related warning and error and that's why application build is failed please solve this ASAP and If I use |
@Viraj-10 Any updates on when #2475 will be released? Nativewind 4.1 supposedly addresses nativewind/nativewind#924, which has been a major hassle for both production and development. |
@miguel93041 you can install v4.1 with |
@ryanmitchell did you ever get this working? I followed the instructions to try and start using gluestack in an existing expo project, but I can't get any styles to be applied to the components. Literally just trying to display a box from the documentation, but none of the styles are working. The component is rendered, but no styles. I also followed all of these instructions, with no luck: https://www.nativewind.dev/getting-started/expo-router |
Hey @flyingL123, Please try this repo. Let me know if it works for you. |
@Viraj-10 yes the repo you provided does work for me. I copied all of the config files from your project to mine, but still no styles are applied. The only difference I notice is that both of our projects are using expo52, but your project uses the new architecture and mine does not. Is there any way that could possibly be causing the problem? Unfortunately I can not share my repo because it's private, but I can try to make a minimal example to reproduce the problem if necessary. |
Hey @flyingL123, Even after disabling new arch it's working for me. Can you please try to reproduce this in similar repo? |
@Viraj-10 I've just updated to Expo 52 and everything is broken again, no styles are being generated. I tried rolling back my changes but still no styles are generated. I cant figure out why. I've tried different node versions (22, 21, 20) and lots of different configurations of tailwinds.config.js and metro.config.js and tsconfig.js. Can I share the repo with you to see if you can see the issue? |
Hey @ryanmitchell, Please try this documentation otherwise please provide a repo so that we will be able to see the issue. |
@Viraj-10 thanks for that, the changes to the metro.config.js file made the difference |
@Viraj-10 - I noticed that the repo I am using, after following the instructions to install gluestack-ui, a Also, while troubleshooting this, after making changes to configuration files, I have been running |
@Viraj-10 here is reproduction of my repo showing gluestack not working. I'm really not sure what else to do. Hope I'm missing something obvious you can point out. Thanks very much for you help. |
Hey @flyingL123, I have created a PR for your repo. Fixing issue with init. I have also updated all the components to latest version. |
@Viraj-10 thank you. I still don't understand what I was doing wrong, but I'll take it. Appreciate the assistance. |
@flyingL123, There was a issue with version of |
I have a similar issue. I am working in a React Native Expo project. I have installed gluestack/ui following all the steps from the official installation guide, I am able to add components but no styling is applied to them. I have tried some of the modifications suggested in previous coments, but the issue persists. This is my Repo. This is the output of ├── @babel/[email protected] |
For anyone who may have a similar issue with styles not being applied, make sure to check your |
Same issue here. I've double check tailwind configuration and it's working fine with react-native composant (Pressable, View...) but when I'm using the Button from gluestack, all the tailwind classes disappear. Only the nativewind classes remain. I also try to use the storybook projects from exemple directory, they are not working... PS : I have to use the [email protected] to be able to make tailwind working, with the last version, all my tailwind classes disappear on render EDIT : I finally make it working on storybook through react-native-web & on device on a monorepo. I don't know if it's because I use a separate app directory to carry on storybook app but it's working now. I still have to downgrade the |
I have the same problem only in this case: I created this folder /src/login/ComponentName.tsx. so when I import this file from app/(login) styles are not apply, but if I moved ComponentName.tsx to /app folder, all styles are applied correctly. |
I am having issue on my new RN Expo project, i refer this https://www.nativewind.dev/getting-started/expo-router and the last step import "../global.css"; then it works for me. |
I tried #2559 (comment) and was able to fix this by removing You can check the changes made by @Viraj-10 in this PR for other possible solutions. Thanks @Viraj-10 |
Discussed in #2526
Originally posted by Wolvinny October 23, 2024
Hi all.
First of all, i am very new to web development. I do have experience in typescript and node, but this is my first time touching web development, other than fooling around a little with React, so this might be a very simple fix but i've been stuck at this for over 6 hours at this point.
Currently, i am stuck on an issue, where i can import buttons and other components just fine, but they just wont be styled.
Following the guide, i first created an expo project (i am using, or well, trying to use react native)
After that, i ran the gluestack-ui init command and added a button (yes, i also added it using the npx command). I also tried the manual installation but this only caused more issues.
Upon running the
npm start
command, and opening the web version, i am greeted with this error:Unable to resolve module '@/global.css' from C:\Users\<>\app\app\_layout.tsx: '@/global.css' could not be found within the project or in these directories: node_modules
.This points to the lines
which for some reason have additional ' in them (again, clean install, i did not change any code)
After removing those; and restarting the web server, and running the following code.
i get the following result:

None of the other components also render.
I am using Node v22.9.0; react v18.2.0 and expo SDK 51.0.38
I cannot make a snack (it freezes when i upload my code) or a sandbox (it does not allow me to upload any files),
but i feel this is a very simple issue that i cannot wrap my head around, nor have i seen someone with the same issue
Full
npm ls
output:The text was updated successfully, but these errors were encountered: