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
React production build result differs from non-production one #6664
Comments
Have you tried with |
If I'm not mistaken, nx sets that env variable automatically when running |
Could you please provide a repo that we can pull down to reproduce the issue? |
@FrozenPandaz Sure. You have a few branches:
Regarding Notes:
|
I can confirm that everything works as expected with Webpack 4. (except this #6485) |
I was the one who has the issue with #6485, this issue will occur in a react app w/o tailwind as well, as soon as you get above 50KB in styles.scss it loses the ability to track the chunks in production build mode only, it works fine if you run the server with the prod flag and injects the css chunks into index.html. I just created a new react app in nx and added a bunch of css fluff to get over 50 KB in styles |
@FrozenPandaz I think you can now remove the repro needed label |
@danr-za I believe you're correct with your comment at #6819 (comment), this issue is related to what I am reporting at #6819. When digging around the code, I found that the The following change fixed my problem: 1a5b78b#diff-52ecb0171c4d78b57f8c7426324be739911887d250d4abc1934e6b1dbba4dc1fL129 (PR #6822). @danr-za can you check if it works for your case as well? This would mean we can close 2 issues with the PR. |
Sure, will test it later today and let you know @markogresak. |
Hi @danr-za 👋 Can you try again with 12.8.0? There were fixes to the style config in that version. I tried the repro app, and I am able to see the Let me know if you continue to run into this issue. |
If it's because of #6558, I know what the issue is and it will be patched soon. |
Hey @jaysoo ! Regarding the |
Closing as everything looks ok since v13 |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
I have a React app which uses Tailwind.
Serve & build are fine, however, a production build does not have any styles applied.
Assuming our project name is
foo
, Runningnx build --project=foo --configuration=production
has few issues:namedChunks: true
, but chunks have a numeric nameextractCss:true
- the build indeed create a css file, but it is not referenced anywhere which results in an app without any styles. (whenextractCss: false
, it works as expected)A non production build works as expected.
Expected Behavior
Should create a working production build as expected by configuration
Steps to Reproduce
extractCss: true
andnamedChunks: true
nx build --configuration=production
and see the result.Environment
The text was updated successfully, but these errors were encountered: