next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Change logic around NON_STANDARD_NODE_ENV

Open erulabs opened this issue 3 years ago • 1 comments

Currently, the NON_STANDARD_NODE_ENV warning is printed on every "next build" or "next start" when NODE_ENV is set to anything, even a valid string like "development" or "production". It is not printed when NODE_ENV is falsey, which I believe is why this issue is not more widely reported.

Changing || to && here I believe corrects the intention - warn the user when an invalid NODE_ENV is set during start or build.

Bug

  • [ ] Related issues linked using fixes #number
  • [ ] Integration tests added
  • [ ] Errors have a helpful link attached, see contributing.md

Feature

  • [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • [ ] Related issues linked using fixes #number
  • [ ] Integration tests added
  • [ ] Documentation added
  • [ ] Telemetry added. In case of a feature if it's used or not.
  • [ ] Errors have a helpful link attached, see contributing.md

Documentation / Examples

  • [ ] Make sure the linting passes by running pnpm build && pnpm lint
  • [ ] The "examples guidelines" are followed from our contributing doc

erulabs avatar Nov 02 '22 16:11 erulabs

Hey @ijjk, thank you! Since the output is a stdout warning that I'm now silencing in the case of a valid NODE_ENV, I'm not sure how to add a test-case. Do we have some sort of stdout capture? Seems like it would be a flaky test. This is cosmetic, so let me know how a test would work!

erulabs avatar Nov 10 '22 15:11 erulabs