Typedoc: Typedoc does not support the pnpm structure of node_modules

Created on 18 May 2018  路  5Comments  路  Source: TypeStrong/typedoc

Since pnpm does not pollute the node_modules folder with peer dependencies this causes an issue when running typedoc with pnpm. In my case I get the following issue:

Using TypeScript 2.7.2 from /Users/near/Source/test/node_modules/.registry.npmjs.org/typescript/2.7.2/node_modules/typescript/lib
Error: /Users/near/Source/test/node_modules/@types/glob/index.d.ts(10)
 Cannot find module 'minimatch'.

I don't know whether this is a TypeScript issue or typedoc issue. If it's the latter than I'd appreciate if you can adapt your parsing of import statements to take into consideration that not all peer dependencies are straight in the node_modules folder. They are all in node_modules/.registry.npmjs.org assuming they are fetched from the generic npm registry. Each package has either soft or hard links inside its own node_modules folder which point to the correct package folder.

enhancement help wanted reproduced

All 5 comments

That looks like an issue with the glob types not typedoc

Related but I don't think it is the same DefinitelyTyped/DefinitelyTyped#11932

@aciccarello I don't think this issue is solved. https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11932 looks like it was created before Typescript added support for symlinks

In a project with pnpm, I can't use typedoc but typescript and ts-related tooling works with no issue

@cortopy Thanks for letting us know. Any tips on how to reproduce?

@aciccarello thank for reopening the issue and your prompt reply!

I've forked an example to replicate:

Steps to replicate

1. npm i -g pnpm
2. git clone [email protected]:cortopy/typedoc.git
3. cd typedoc/examples/basic
4. git checkout test-pnpm
5. pnpm i
6. npx typedoc --module commonjs --includes inc/ --media media/ --target ES5 --json json.json --out doc/ src/

You can find the failing-fle.ts in the src folder. It's using external packages. Basically those are the ones that were creating some issues for me

Although I should also point out that if you run tsc in that folder, the whole project build ok, no issues found

This appears to been fixed, I just set up a project using pnpm and was unable to reproduce

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShadowManu picture ShadowManu  路  4Comments

topherfangio picture topherfangio  路  3Comments

Rycochet picture Rycochet  路  4Comments

atomsoftwarestudios picture atomsoftwarestudios  路  4Comments

3nsoft picture 3nsoft  路  3Comments