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

Broken Link caused by Typescript class being defined in an index file #402

Closed
rbala19 opened this issue Feb 22, 2023 · 4 comments
Closed
Labels
next Fix available in the '@next' release

Comments

@rbala19
Copy link

rbala19 commented Feb 22, 2023

Note: I have previously discussed this bug on the docusaurus repo and they referred me here. I have created a reproduction for the bug in this repo: https://github.com/rbala19/docusarus-reprod. Because this project is inherently a docusaurus project, I have included all docusaurus plugins that I used in combination with typedoc-plugin-markdown - if that makes it difficult to track the bug down, please let me know and I can make a more minimal reproduction of the error.

Reproduction: https://github.com/rbala19/docusarus-reprod

I define a Typescript class in libs/examples/basic/src/index.ts. I additionally list libs/examples/basic/src/index.ts as a module markdown entrypoint in my docusaurus config in doc_site/docusaurus.config.js. Interestingly, upon running docusaurus build, any link to the class defined in index.ts will be malformed.

Exhaustive list of all broken links found:

  • On source page path = /code/@app/example-library/modules/:
    -> linking to ../classes/.TestDocusaurusFailure (resolved as: /code/@app/example-library/classes/.TestDocusaurusFailure)

Seemingly, because index is a keyword used by the compiler, it is also stripped from the URL pointing to the class file. NPM environment is outlined on the reprod. Please let me know if any other information is required.

@kaosfere
Copy link

Experiencing this same problem.

Node 16.8.1
NPM 8.19.2
docusaurus 2.2
docusaurus-plugin-typedoc 0.18.0
typedoc-plugin-markdown 3.14.0

@tgreyuk
Copy link
Member

tgreyuk commented Apr 18, 2023

Apologies for the delay on this. The example repo was very useful. Marking this fixed in next version.

Can be tested with

"docusaurus-plugin-typedoc": "next",
"typedoc-plugin-markdown": "next",

@tgreyuk tgreyuk added the next Fix available in the '@next' release label Apr 18, 2023
@vermaysha
Copy link

Apologies for the delay on this. The example repo was very useful. Marking this fixed in next version.

Can be tested with

"docusaurus-plugin-typedoc": "next",
"typedoc-plugin-markdown": "next",

Maybe this is off topic, but this issue also occurs in the vuepress-plugin-typedoc package.

vuepress-plugin-typedoc 0.12.1

@tgreyuk
Copy link
Member

tgreyuk commented May 3, 2024

typedoc-plugin-markdown@4.0.0
docusaurus-plugin-typedoc@1.0.0

@tgreyuk tgreyuk closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next Fix available in the '@next' release
Projects
None yet
Development

No branches or pull requests

4 participants