Skip to content

--includeDeclarations causes typedoc to hang indefinitely #913

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

Closed
balupton opened this issue Dec 7, 2018 · 5 comments
Closed

--includeDeclarations causes typedoc to hang indefinitely #913

balupton opened this issue Dec 7, 2018 · 5 comments

Comments

@balupton
Copy link

balupton commented Dec 7, 2018

Affecting eachr#dev-typescript-dts

Reproduce with:

git clone [email protected]:bevry/eachr.git
cd eachr
git checkout dev-typescript-dts
npm install
npm run our:meta:docs:typedoc

Hangs with:

> [email protected] our:meta:docs:typedoc /Users/balupton/Projects/active/eachr
> typedoc --includeDeclarations --mode file --exclude '**/*test*' --name "$npm_package_name" --readme ./README.md --out ./docs ./source


Using TypeScript 3.1.6 from /Users/balupton/Projects/active/eachr/node_modules/typedoc/node_modules/typescript/lib

And the version details:

> uname -a
Darwin balbook-2018.local 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64

> typedoc --version

TypeDoc 0.13.0
Using TypeScript 3.1.6 from /usr/local/lib/node_modules/typedoc/node_modules/typescript/lib
@aciccarello
Copy link
Collaborator

I was able to run locally in ~190 seconds on a relatively fast computer which is not great but it did complete. I would recommend excluding the node modules directory to avoid unnecessary documentation as that appears to be the main cause of the slowdown. Using the option --exclude '**/+(*test*|node_modules)/**' in combination with the changes from #896 brought the build down to under 5 seconds.

@aciccarello
Copy link
Collaborator

Response from @9oelM merged from #919:

The problem

Yes I have looked at #913 and the comment by @aciccarello also. But I still find that --includeDeclarations option would make typedoc hang like forever without any warnings if there are no d.ts declaration files.

Context

I was planning to add d.ts files later on but I did not want to edit typedoc config later too, so I just added includeDeclarations option to the config (typedoc.js). But the problem was typedoc would hang somewhere in its process, probably looking for .d.ts files.

I tested this problem each time with the option specified on cli (by specifying --includeDeclarations) and in typedoc.js in rootdir.

Reproducing the problem

You can test directly from c9.io here:
(on c9 cli)

typedoc --out docs test.ts

or git clone this repo to test it out:

git clone https://github.com/9oelM/typedoc-test.git
cd typedoc-test
npm install
typedoc --out docs test.ts

this is going to show something like

Using TypeScript 3.1.6 from /home/ubuntu/workspace/node_modules/typedoc/node_modules/typescript/lib

and hang forever.

This is the content of the config file used:
typedoc.js

module.exports = {
  module: "commonjs",
  mode: "modules",
  target: "es5",
  out: "docs/",
  name: "justTesting",
  exclude: ["node_modules/**", "**/"],
  includeDeclarations: true,
}

I waited for several minutes but it won't work. It is even clearer that includeDeclarations option is the problem when you test it out without it (just exclude the last line from the above config):

$ typedoc --out docs test.ts 

Using TypeScript 3.1.6 from /home/ubuntu/workspace/node_modules/typedoc/node_modules/typescript/lib
Rendering [========================================] 100%

Documentation generated at /home/ubuntu/workspace/docs

It would work without includeDeclarations specified.

So..

I just hope there would be some kind of safety measures in case users put includeDeclarations option in advance of creating d.ts files, or by any other ignorance because it is typedoc is going to hang forever and not going to tell you the problem!

@aciccarello
Copy link
Collaborator

@9oelM What makes you think that TypeDoc isn't hanging on type definition files in node_modules?

@9oelM
Copy link
Contributor

9oelM commented Dec 18, 2018

@aciccarello woops. did not realize there is a problem in the exclude option, especially when excluding node_modules, as suggested by many other issues. Hope the #896 is going to be merged soon...

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 3, 2019

With the v0.14.0 release, this has been resolved thanks to #890 and #896

@Gerrit0 Gerrit0 closed this as completed Jan 3, 2019
balupton added a commit to bevry/boundation that referenced this issue Jan 25, 2019
as the v0.14 release has a workaround bugfix for it:

- TypeStrong/typedoc#913
- TypeStrong/typedoc#896
@Gerrit0 Gerrit0 removed the bug label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants