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

fix(react): fix conflicting NODE_ENV values between an application an… #9460

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

ndcunningham
Copy link
Contributor

Fix conflicting NODE_ENV values between an application and webpack Plugins (DefinePlugin)

ISSUES CLOSED: #7924

Current Behavior

Currently, serving a fresh Nx React application shows the following:

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

Expected Behavior

On freshly served applications there should be no such warning as stated above.

Related Issue(s)

Fixes #

…d webpack Plugins (DefinePlugin)

ISSUES CLOSED: nrwl#7924
@nx-cloud
Copy link

nx-cloud bot commented Mar 22, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit 99182fe. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 7 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Mar 22, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/8qFwYSAHzw1zuA7tm8gz4jYHwzKR
✅ Preview: Canceled

@jaysoo
Copy link
Member

jaysoo commented Mar 22, 2022

LGTM

@jaysoo jaysoo merged commit cdbea91 into nrwl:master Mar 22, 2022
const isScriptOptimizeOn =
typeof options.optimization === 'boolean'
? options.optimization
: options.optimization && options.optimization.scripts
Copy link

@nemonemi nemonemi Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be possible to be shortened and simplified:

typeof options.optimization === 'boolean'
      ? options.optimization
      : options.optimization?.scripts || false

@nemonemi
Copy link

Has this been released yet?

@RJSonnenberg
Copy link

RJSonnenberg commented Mar 23, 2022

Has this been released yet?

Not yet, @nemonemi. 13.9.4 was released before this fix was merged. 13.9.5 should include this fix.

@tijmenvangurp
Copy link

13.9.5 should include this fix.

Any idea when this will be released? looking for a fix to this issue!

FrozenPandaz pushed a commit that referenced this pull request Mar 25, 2022
…d webpack Plugins (DefinePlugin) (#9460)

ISSUES CLOSED: #7924

Co-authored-by: Nicholas Cunningham <ndcunningham>
@nemonemi
Copy link

This issue has not been resolved with 13.9.5.

@RJSonnenberg
Copy link

I can confirm, the issue still remains on both existing apps and newly-generated apps. Verified that both global and local nx was on 13.9.5. Serving app on Windows still results in the following warning:

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

sidmonta pushed a commit to sidmonta/nx that referenced this pull request Apr 2, 2022
…d webpack Plugins (DefinePlugin) (nrwl#9460)

ISSUES CLOSED: nrwl#7924

Co-authored-by: Nicholas Cunningham <ndcunningham>
@ndcunningham ndcunningham deleted the defect/fix-conflicting-node-env branch April 7, 2022 14:55
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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