fix: propagate dotenv read errors - #21894
Conversation
🦋 Changeset detectedLatest commit: afcdcdc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe dotenv loader now treats only ChangesDotenv error handling
Merge Risk: ⚪ Minimal · up to The change makes unexpected dotenv filesystem errors fail compilation instead of being silently ignored while preserving optional missing-file behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Dotenv treated every file read failure as a missing optional file, silently swallowing permission errors and other I/O faults. Only
ENOENTandENOTDIRare now recorded as missing dependencies; all other errors reject compilation.What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes. Unit regressions cover both expected missing-file codes and
EACCESpropagation. The focused suite passes 3 tests, and all lint, generated-output, type, format, spelling, changeset, and diff checks pass.Does this PR introduce a breaking change?
No. Real configuration I/O failures are now reported instead of silently ignored.
If relevant, did you update the documentation?
A patch changeset documents the error-handling correction. No public documentation change is required.
Use of AI
Significant AI assistance was used to audit dotenv loading and draft the fix and regression tests. I reviewed the final diff and verification results.
Summary by CodeRabbit