[BUG] process.env - Cannot read properties of undefined (reading 'env')
- Dominant language
- TypeScript
- Stars
- 5.5k
- Forks
- 379
- Avg merge
- 2h 8m
- Merged PRs (30d)
- 6
Description
**Describe the bug**
Using `process.env.whatever` in a danger file leads to a runtime error stating that `process` is undefined.
**To Reproduce**
1. Create a dangerfile
2. Add a reference to `process.env`
3. See the error
**Expected behavior**
You should be able to access `process.env`
**Screenshots**

**Your Environment**
| software | version
| ---------------- | -------
| danger.js | 11.2.0
| node | `node:16` docker image
| npm | 7.11.0 (pnpm)
| Operating System | Gitlab CI
**Additional context**
Add any other context about the problem here.
Contributor guide
Research direction
Reproduce the issue with a dangerfile that references process.env under the reported Node 16 GitLab CI environment. Trace how dangerfiles are executed and verify that a dangerfile can read process.env without the runtime error; confirm the behavior in a focused test if the project has coverage for this execution path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- ci-cd, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100