You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maximum call stack size exceeded, recursive type, recursive default type parameter
Expected Behavior
Typedoc generates output without error
Actual Behavior
Typedoc throws RangeError: Maximum call stack size exceeded
Stack trace (while most of this is in lodash, the loop seems to be occuring around Converter.convertTypes.
RangeError: Maximum call stack size exceeded
at isArrayLike (PROJDIR/node_modules/lodash/lodash.js:11333:58)
at isArrayLikeObject (PROJDIR/node_modules/lodash/lodash.js:11362:37)
at PROJDIR/node_modules/lodash/lodash.js:8471:13
at arrayFilter (PROJDIR/node_modules/lodash/lodash.js:582:11)
at Function.unzip (PROJDIR/node_modules/lodash/lodash.js:8470:15)
at apply (PROJDIR/node_modules/lodash/lodash.js:474:27)
at Function.zip (PROJDIR/node_modules/lodash/lodash.js:6563:16)
at Converter.convertTypes (PROJDIR/node_modules/typedoc/dist/lib/converter/converter.js:140:11)
at ReferenceConverter.convertType (PROJDIR/node_modules/typedoc/dist/lib/converter/types/reference.js:48:47)
at Converter.convertType (PROJDIR/node_modules/typedoc/dist/lib/converter/converter.js:133:38)
Steps to reproduce the bug
Minimal reproduction gist. To reproduce, install packages (I'm using yarn), and run typedoc with no arguments.
It looks like the root of this issue is the two-step recursive default for the Example default type argument (Example<ExampleParam> -> Example<Example>). Removing the type alias causes TS itself to error - leaving it in causes this loop in typedoc alone.
ackwell
changed the title
Call stack error when generating documentation for recursive types
Call stack error when generating documentation for types with self-recursive type arguments
Jul 1, 2020
Recursive types are a pain. Fixed in 7fc721c. I should be able to put a release together tomorrow. Thanks for the reproduction! It was really helpful in narrowing down the issue quickly.
Hi, this issue is marked as closed - but the code has never been released. I just started with TypeDoc and for whatever reason - it has this crash when I try to run it.
I was able to pull master and build lastest. But you really should release this fix - it is a bad sign for the health of this project.
"bad sign for the health of the project" - I work on TypeDoc when I have time on the weekends. Aside from occasional PRs from others, that's all it has... and is more than it had for quite a while. I think TypeDoc will be around for a while. If you need a project which is more enterprise grade, I recommend taking a look at api-extractor.
Search terms
Maximum call stack size exceeded, recursive type, recursive default type parameter
Expected Behavior
Typedoc generates output without error
Actual Behavior
Typedoc throws
RangeError: Maximum call stack size exceeded
Stack trace (while most of this is in lodash, the loop seems to be occuring around
Converter.convertTypes
.Steps to reproduce the bug
Minimal reproduction gist. To reproduce, install packages (I'm using yarn), and run
typedoc
with no arguments.It looks like the root of this issue is the two-step recursive default for the
Example
default type argument (Example<ExampleParam>
->Example<Example>
). Removing the type alias causes TS itself to error - leaving it in causes this loop in typedoc alone.(The above is updated, original reproduction made use of
@types/color
, where I first encountered this issue. It, likewise, has the same construct shown in this reproduction.)Environment
The text was updated successfully, but these errors were encountered: