Stylex production is not showing any styles
Describe the issue
Mine is Nextjs project V14.0.1 with StyleX V0.5.1> I compiled the nextjs project and run the preview build. It was fine for the first time. Then I deployed it to the firebase hosting and viewed, none of the style was added. All the pages are without styles. I have done the same config as given in your repo for Nextjs project. I even tried deleting the .next folder. It worked only for the first time.
Expected behavior
I was expecting to see the development as a final product but styles are not applied.
Steps to reproduce
get the next V14.0.1 project
install stylex latest and compile it
check the production version.
Test case
No response
Additional comments
No response
Do you have a CSS file with global styles that is being imported by the outermost layout.tsx file?
The Next setup inserts the generated styles into an existing CSS file. If there' no CSS file, the styles are lost.
yes. I have a CSS file which is global.css and it is imported in the layout.tsx too. I think I know the problem. When I build the app using custom babel config, the production works. but when I run the firebase deploy command, it runs its own config to build the next app, so that it doesn't care about StyleX config. Am I correct?
That seems likely. I haven't used firebase, so I can't say for sure.
I talked to firebase support and they confirmed that they cannot do anything at their end. Is there any possibilities to solve this issue? I used output: "export", line in the next.config.js and it exports a folder called out. I directly uploads that file into firebase hosting and it works. but I think it is not the way to build the proper app isn't it? any suggestions !!
I don't know what Firebase is doing to build the app. It is possible that they're sidestepping the custom configuration and using the default build config for NextJS instead.
In NextJS, you can do npm run build to get a folder with the built output which you can test locally with npm start. See if that is setup correctly for you and works. If that works locally, but not on Firebase, it might be outside the scope of something we can fix on our end.
You can fix or you can't !!!
The CLI included in the next release should solve this problem