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
Running nx serve on a React app serves it in production mode #9241
Comments
You should be able to fix this by either change your or change your |
Thanks, I'll try and see if that helps |
@owen26 thanks for the suggestions - these worked for us in the end after some trial and error. Like @cristian-aldea if we switch between versions we were getting: We updated to
Any idea why this change needed additional tweaks to config? This still feels like a regression given no code changes give different results between versions? Any help anyone can give would be gratefully received. Thanks! |
Found the cause of this issue - see comment here: Thanks. |
I'm thinking of closing down this issue, since it seems my issue has the same root cause as #7924 thank you to all who looked into the issue and informed everyone of how to address it. |
seems a bit odd that this is the default... this causes each recompile to take 10 to 15 seconds... changing defaultConfiguration to development in the project json brings this down to 1 or 2 seconds |
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
A react application being served with
nx serve
is served in production mode. Also, you get the following warning:See #7924
Expected Behavior
I expect that when I run my frontend application with
nx serve
, it is run in development mode with no warnings.This seems to be a regression. I was not getting this issue in 13.8.3, and in fact reverting the @nrwl/* package versions back to 13.8.3 fixed the issue.
Steps to Reproduce
npx create-nx-workspace temp
react-express
for "What to create in the new workspace"scss
for "Default stylesheet format"console.log(environment.production);
somewhere in the function definition of the App component. Make sure to importenvironment
from../environments/environment
, and not../environments/environment.prod
nx serve temp
to run the react applicationtrue
printing in the browser console, indicating that the environment.ts file replacement was done, and therefore that the production mode was turned onFailure Logs
Environment
The text was updated successfully, but these errors were encountered: