Use Optional Chaining to `globalThis.process.env.NODE_ENV` Retrieval
This PR introduces optional chaining when accessing globalThis.process.env.NODE_ENV in the graphql-js codebase.
The current implementation assumes that globalThis.process.env is always defined, which may not be the case in all environments. This assumption leads to a runtime error when NODE_ENV is accessed on an undefined process.env.
By adding optional chaining (?.), we ensure that NODE_ENV is only accessed if globalThis.process and process.env are defined, thereby preventing potential runtime errors.
This change improves the robustness of the code and makes it more compatible with various JavaScript environments.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: johnfabre (dd99b7ee234f8c37ea3916a9f02d29a1a2c78a13)
Deploy Preview for compassionate-pike-271cb3 ready!
| Name | Link |
|---|---|
| Latest commit | dd99b7ee234f8c37ea3916a9f02d29a1a2c78a13 |
| Latest deploy log | https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/65c9e51f1faac900081b9445 |
| Deploy Preview | https://deploy-preview-4019--compassionate-pike-271cb3.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This is a duplicate of https://github.com/graphql/graphql-js/pull/4017
The committers listed above are authorized under a signed CLA.
- ✅ login: johnfabre (dd99b7e)
added myself to CLA
This is a duplicate of #4017
used the code suggested in here https://github.com/graphql/graphql-js/pull/4017/files#r1483265402
Fixed with https://github.com/graphql/graphql-js/pull/4022