Skip to content
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

Cannot serve production version of app #10199

Closed
joestrkr opened this issue May 8, 2022 · 1 comment · Fixed by #10235
Closed

Cannot serve production version of app #10199

joestrkr opened this issue May 8, 2022 · 1 comment · Fixed by #10235
Labels
outdated scope: react Issues related to React support for Nx type: bug

Comments

@joestrkr
Copy link

joestrkr commented May 8, 2022

Current Behavior

When trying to serve a production version of my react app, I always get the warning about conflicting NODE_ENV values. This only happens with serve. Building the app works as expected for both dev and prod modes.

To make sure that it is not some configuration issue in my repo I created a fresh workspace with nx 14.1.4 and it is totally reproducible. The build is always running in development mode.

Expected Behavior

When I run serve in prod mode, the app should be built in prod mode.

Steps to Reproduce

Create a new workspace and try to serve the app in prod mode.

npx create-nx-workspace@latest test --preset=react --appName=demo

# Then serve
nx serve demo --prod

Failure Logs

WARNING in DefinePlugin
Conflicting values for 'process.env.NODE_ENV' 

Environment

Node : 16.15.0
OS   : darwin arm64
npm  : 8.5.5

nx : 14.1.4
@nrwl/angular : Not Found
@nrwl/cypress : 14.1.4
@nrwl/detox : Not Found
@nrwl/devkit : 14.1.4
@nrwl/eslint-plugin-nx : 14.1.4
@nrwl/express : Not Found
@nrwl/jest : 14.1.4
@nrwl/js : 14.1.4
@nrwl/linter : 14.1.4
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : 14.1.4
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.1.4
@nrwl/web : 14.1.4
@nrwl/workspace : 14.1.4
typescript : 4.6.4
rxjs : 6.6.7
---------------------------------------
Community plugins:
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: react Issues related to React support for Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants