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

[warning] TypeDoc has been loaded multiple times. This is commonly caused by plugins which have their own installation of TypeDoc. #676

Closed
sthyagarajan opened this issue Aug 16, 2024 · 8 comments
Labels
bug Issue raised as a bug. needs reproduction Can't reproduce or fix without an example

Comments

@sthyagarajan
Copy link

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

[warning] TypeDoc has been loaded multiple times. This is commonly caused by plugins which have their own installation of TypeDoc.
The above warning prevents the instanceof checks for DeclarationReflection to fail and no docs are generated, if I remove plugin it works but obviously I like to get my MD file

TypeDoc configuration

{
"entryPoints": [
"src/index.ts"
],
"entryPointStrategy": "expand",
"excludePrivate": false,
"excludeProtected": false,
"excludeExternals": true,
"out": "./docs",
"hideGenerator": true,
"disableSources": true,
"navigationLinks": {
"Home": "~~~~my url~~~ REDACTED"
},
"expandObjects": true,
"expandParameters": true,
"plugin": [
"typedoc-plugin-zod",
"typedoc-plugin-markdown"
],
"excludeNotDocumented": false,
"excludeNotDocumentedKinds": [
"Variable"
],
"exclude": ["/node_modules/"]
}

Expected behavior

Expectation is it will create MD files of all my classes under docs folder that can be hosted as github pages

@sthyagarajan sthyagarajan added the bug Issue raised as a bug. label Aug 16, 2024
@tgreyuk
Copy link
Member

tgreyuk commented Aug 18, 2024

Unfortunately I am unable to debug this with the required information. I assume your setup isn't available on a public repo?

@sthyagarajan
Copy link
Author

Unfortunately I am unable to debug this with the required information. I assume your setup isn't available on a public repo?

yes unfortunately nope, what do you need, I get the above warning as I run yarn docs and I see multiple versions of typedoc in node_modules coming from plugin and a direct dependency

@tgreyuk
Copy link
Member

tgreyuk commented Aug 19, 2024

Typedoc is only a peer dependency. Do you get the same warning in the markdown plugin is the only plugin if the plugins list?

@sthyagarajan
Copy link
Author

If I remove mardown plugin, typedoc gets generated obviously as HTML

@tgreyuk
Copy link
Member

tgreyuk commented Aug 19, 2024

If I remove mardown plugin, typedoc gets generated obviously as HTML

Yes "obviously" it does. I meant do you get the warning if its the only plugin ie: plugins: ['typedoc-plugin-markdown']. I noticed that the zod plugin was in the list so i'm wondering if different peer dependancy versions might be causing the issue.

@sthyagarajan
Copy link
Author

Yes

 yarn docs           
yarn run v1.22.10
$ rm -rf docs/api && typedoc -githubPages false
[info] Loaded plugin typedoc-plugin-markdown
[warning] TypeDoc has been loaded multiple times. This is commonly caused by plugins which have their own installation of TypeDoc. The loaded paths are:
        /Users/<username>/node_modules/typedoc
        /Users/<username>/node_modules/typedoc
[info] Documentation generated at ./docs
[warning] Found 0 errors and 1 warnings
    "plugin": [
        "typedoc-plugin-markdown"
    ]

@tgreyuk
Copy link
Member

tgreyuk commented Aug 25, 2024

It seems that TypeDoc is being installed twice in your node modules, but typedoc is only a peer dependency of this plugin. Without an reproducable example to test against I don't think any progress can be made on this one.

@tgreyuk tgreyuk added the needs reproduction Can't reproduce or fix without an example label Aug 25, 2024
@tgreyuk
Copy link
Member

tgreyuk commented Sep 5, 2024

This bug is most likely related to this:

Note: If you install globally, be aware that npm/cli#7057 means that plugins and themes will get their own installation of TypeDoc unless you use the --legacy-peer-deps flag. This will break many plugins and cause warnings from TypeDoc.

See: https://typedoc.org/guides/installation/#requirements

I don't believe there is anything that can be done on the plugin side.

@tgreyuk tgreyuk closed this as completed Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue raised as a bug. needs reproduction Can't reproduce or fix without an example
Projects
None yet
Development

No branches or pull requests

2 participants