-
-
Notifications
You must be signed in to change notification settings - Fork 750
Description
I've been having trouble with TypeDoc and up until yesterday I was under the impression that TypeDoc was at fault, but after a lot of digging I reduced my failing docs build down to a small subset of components, they all had one thing in common, schema-dts. I posted on an existing open issue with them to get their input, they suggested I also open an issue here as there is still an expectation that TypeDoc should be able to traverse large type trees without leading to OOM errors and frankly I have to agree with that logic.
I created a minimal repo to test against and found that I could easily reproduce the issue. My project was using schema-dts@0.4.4 and I was getting a JavaScript heap out of memory error, upgrading to schema-dts@0.6.0 fixed a number of my files but still hangs on some. The schema-dts@0.5.0 and up releases have a number of improvements specifically relating to improving TypeScript performance. Setting --max_old_space_size=8048 prevents the OOM error but the build hangs indefinitely.
The schema-dts types are massive, I can't say if they should be done differently to limit the overhead placed on the compiler but we require these type definitions in order to adhere to schema.org structured data throughout our systems.
TypeDoc: 0.18.0 (also rolled all the way back to 0.15.0 and had similar results)
TS: 3.9.7
Node: v12.18.0
Ubuntu 20.04 (Windows 10 WSL2)
Related schema-dts issues:
google/schema-dts#34
Minimal Example:
https://github.com/nedkelly/typedocissue
Any help would be much appreciated.