[BUG]: Endpoints union types causes tsc to abort with out of memory error #666
Labels
Status: Triage
This is being looked at and prioritized
Type: Bug
Something isn't working as documented, or is being fixed
What happened?
I'm building docker images for two projects which both has a dependency (my project as well) that in turn depends on a bunch of
@octokit
packages including@octokit/types
. However, it started getting oom errors fromtsc --emitDeclarationOnly
.When debugging the issue, I ran
tsc --emitDeclarationOnly --generateTrace trace-folder
to get atrace.json
andtypes.json
file (see instructions here). Examining the trace revealed thattsc
is has very deep recursive events for type-checking theEndpoints
type in thecheckSourceFile
with an event calledtraceUnionsOrIntersectionsTooLarge_DepthLimit
.I haven't found a viable solution since I can't tell typescript to ignore type-checking of
@octokit/types
only. The--skipLibCheck
option has no effect, possibly because the package is indirectly included in the source code through imports. AddingNODE_OPTIONS="--max-old-space-size=4096"
to the docker build or increasing the memory limit in Docker Desktop solves the issue but is more symptom treatment than a cure. This might be an issue with the typescript compiler, although a large recursive type would explain the oom error, so I'll submit some info to them as well.Interestingly,
eslint
also runs out of memory at times. EDIT: This might be because I also havetypescript-eslint
installed which calls the typescript's typechecking APIs to enable type-aware linting.An aside: The link to your code of conduct in the issue template is broken.
Versions
Versions as given in a direct dependency for both projects.
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: