fix: Consolidate type exports to resolve 'too many open files' error in serverless environments#1241
Merged
ramya18101 merged 2 commits intomasterfrom Nov 6, 2025
Merged
Conversation
kushalshit27
approved these changes
Nov 6, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1241 +/- ##
==========================================
- Coverage 79.94% 78.19% -1.75%
==========================================
Files 515 354 -161
Lines 19287 17742 -1545
Branches 9555 9413 -142
==========================================
- Hits 15419 13874 -1545
Misses 3868 3868
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ramya18101
approved these changes
Nov 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This PR consolidates the Management API type exports by combining all individual type definition files into a single
types.tsfile. This significantly reduces the number of files that need to be opened during module resolution, resolving the 'EMFILE: too many open files' errors experienced in serverless environments like Vercel and AWS Lambda.What changed:
src/management/api/types/types.tsfilesrc/management/api/types/index.tsto re-export from the consolidated types fileWhy this is important:
This fixes a critical issue where the SDK v5 would fail to deploy on serverless platforms (Vercel, AWS Lambda) due to exceeding the operating system's limit on open file descriptors. The previous implementation had each type definition in a separate file, which caused Node.js to open too many files simultaneously during module resolution.
References
Testing
How to test:
Checklist