Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum call stack size exceeded #18

Closed
jerethom opened this issue Aug 14, 2020 · 6 comments
Closed

Maximum call stack size exceeded #18

jerethom opened this issue Aug 14, 2020 · 6 comments
Labels
bug Something isn't working needs reproduction Bug needs to be reproduced first before it can be fixed.

Comments

@jerethom
Copy link

Hi,

First of all thank you for the initiative for this package.
I installed the package and tried to generate the documentation but I got a Maximum call stack size exceeded error in return.

Have you ever had this problem before?

Thank you in advance

My package.json file.

{
  ...
  "devDependencies": {
    ...
    "typedoc": "0.18.0",
    "typedoc-plugin-mermaid": "1.3.0",
    "typedoc-plugin-pages": "1.0.1",
    "typedoc-umlclass": "0.2.2",
    "typescript": "3.9.7",
    ...
  }
}

My command line.

rimraf dist-doc && typedoc --out dist-doc --mode file --tsconfig src/tsconfig.json --theme pages-plugin types src

The error

Loaded plugin /.../node_modules/typedoc-plugin-mermaid
Loaded plugin /.../node_modules/typedoc-plugin-pages
Loaded plugin /.../node_modules/typedoc-umlclass

Using TypeScript 3.9.7 from /.../node_modules/typescript/lib
Rendering [==============--------------------------] 34%/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:163
        let subTypes = new Array();
                       ^

RangeError: Maximum call stack size exceeded
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:163:24)
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)
    at Function.getSubTypesForReflection (/.../node_modules/typedoc-umlclass/dist/typedoc/typedoc_utils.js:181:65)

@krisztianb
Copy link
Owner

Hi @jerethom. No, I haven't ran into this issue yet. Could you please try to reproduce the issue with an older version of typedoc (eg. 0.17.8)? I haven't used the plugin with 0.18.0 yet and read about some changes concerning types. This is just to figure out first if the problem is related to the plugin or typedoc itself.

@jerethom
Copy link
Author

jerethom commented Aug 14, 2020

I had the same error up to version 0.17.7, at version 0.17.6 I had this error which must be the same as this one.

Loaded plugin /.../habu/node_modules/typedoc-plugin-mermaid
Loaded plugin /.../habu/node_modules/typedoc-plugin-pages
Error: The plugin /.../habu/node_modules/typedoc-umlclass could not be loaded.

Error: umlClassDiagramBoxBorderWidth must be >= 0
    at Object.convert (/.../node_modules/typedoc/dist/lib/utils/options/declaration.js:37:23)
    at Options.setOptionValueToDefault (/.../node_modules/typedoc/dist/lib/utils/options/options.js:119:64)
    at Options.addDeclaration (/.../node_modules/typedoc/dist/lib/utils/options/options.js:53:14)
    at PluginOptions.addToApplication (/.../node_modules/typedoc-umlclass/dist/plugin_options.js:349:25)
    at Plugin.addOptionsToApplication (/.../node_modules/typedoc-umlclass/dist/plugin.js:121:22)
    at Plugin.initialize (/.../node_modules/typedoc-umlclass/dist/plugin.js:113:14)
    at load (/.../node_modules/typedoc-umlclass/dist/index.js:10:27)
    at PluginHost.load (/.../node_modules/typedoc/dist/lib/utils/plugins.js:28:21)
    at CliApplication.bootstrap (/.../node_modules/typedoc/dist/lib/application.js:50:22)
    at CliApplication.bootstrap (/.../node_modules/typedoc/dist/lib/cli.js:29:30)
/.../node_modules/typedoc/dist/lib/utils/options/declaration.js:37
                throw new Error(getBoundsError(numberOption.name, numberOption.minValue, numberOption.maxValue));
                ^

Error: umlClassDiagramBoxBorderWidth must be >= 0
    at Object.convert (/.../node_modules/typedoc/dist/lib/utils/options/declaration.js:37:23)
    at Options.setOptionValueToDefault (/.../node_modules/typedoc/dist/lib/utils/options/options.js:119:64)
    at Options.reset (/.../node_modules/typedoc/dist/lib/utils/options/options.js:24:18)
    at CliApplication.bootstrap (/.../node_modules/typedoc/dist/lib/application.js:51:22)
    at CliApplication.bootstrap (/.../node_modules/typedoc/dist/lib/cli.js:29:30)
    at Object.<anonymous> (/.../node_modules/typedoc/bin/typedoc:5:5)

@krisztianb
Copy link
Owner

Yes, you should not go lower than the peer dependency version, which is: 0.17.7

Ok, then this might be a bug in the plugin. Can I ask you to use the option --umlClassDiagramVerboseOutput true and try again? This should output some debug info and might help us find out which type is causing the problem. We might then look at that type to see if there is anything special about it.

@krisztianb krisztianb added the bug Something isn't working label Aug 17, 2020
@krisztianb krisztianb added the needs reproduction Bug needs to be reproduced first before it can be fixed. label Sep 12, 2020
@krisztianb
Copy link
Owner

Looking at the code this could be caused by recursive type definitions. Could you provide any update please? If not I will have to somehow investigate this myself.

@krisztianb
Copy link
Owner

Unfortunately I can't reproduce this issue. @jerethom could you provide some feedback to debug this issue further? Are you by any change using the typedoc flag --ignoreCompilerErrors?

@krisztianb
Copy link
Owner

Since I can't reproduce this issue and ignoreCompilerErrors has been removed from the latest TypeDoc version I'm closing this as "cannot reproduce".

If someone can reproduce this issue feel free to post here or open a new one. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs reproduction Bug needs to be reproduced first before it can be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants