An example project to reproduce TypeDoc bug with links in "throws"
Install dependencies and run examples:
npm ci
npm run examples
You can also run a single example (example1
, example2
, example3
):
npm run example1
- Source:
./example1/
- Output:
./docs1/
- Config:
./typedoc-example1.config.js
typedoc
result:
[warning] Failed to resolve link to "ImportedError" in comment for example/Example.Example.importedError
[info] html generated at ./docs1
[warning] Found 0 errors and 1 warnings
- Screenshot of generated Example class:
./example1.png
- Only 5 of 6 links to
*Error
are present ImportedError
that was placed right after@throws
is just plain text, not a link
- Only 5 of 6 links to
- Differences compared to
example1
:main.ts
was deleted - only files insideexample/
dir are present
- Source:
./example2/
- Output:
./docs2/
- Config:
./typedoc-example2.config.js
typedoc
result:
[info] html generated at ./docs2
- Screenshot of generated Example class:
./example2.png
- All 6 links to
*Error
are present
- All 6 links to
- Differences compared to
example1
:main.ts
was replaced withindex.ts
that re-exports everything fromexample/
dir- TypeDoc config was changed to use the
index.ts
file asentryPoint
,entryPointStrategy
option was removed
- Source:
./example3/
- Output:
./docs3/
- Config:
./typedoc-example3.config.js
typedoc
result:
[info] html generated at ./docs3
- Screenshot of generated Example class:
./example3.png
- All 6 links to
*Error
are present
- All 6 links to
It looks like if the following conditions are met:
entryPointStrategy
is set toexpand
,- any
*.ts
file is present in a directory above the target file (Example.ts
in this case), but inside the directory specified inentryPoints
then the link that occurs right after @throws
is rendered as plain text instead of a link (for imported classes):
/**
* {@link RendersAsLink}
* @throws {@link RendersAsPlainText} - {@link RendersAsLink}
*/