typedoc2md / typedoc-plugin-markdown

A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
https://typedoc-plugin-markdown.org
MIT License
702 stars 176 forks source link

Multi instance config gives the error 'The "path" argument must be of type string. Received undefined' #420

Closed arantespp closed 1 year ago

arantespp commented 1 year ago

I'm using typedoc-plugin-markdown with multi-instance config, and I'm getting the error when I try to build my Docusaurus project with some specifics configuration (please, see How to reproduce section) on my monorepo using pnpm:

[ERROR] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

The configuration I'm using:

 plugins: [
    path.resolve(__dirname, 'lifecycle/carlin'),
    ...[
      'config',
      'forms',
      'i18n-cli',
      'react-i18n',
      // 'ui'
    ].map((package) => {
      return [
        'docusaurus-plugin-typedoc',
        {
          id: package,
          entryPoints: [`../../packages/${package}/src/index.ts`],
          tsconfig: `../../packages/${package}/tsconfig.json`,
          out: `modules/packages/${package}`,
          sidebar: {
            categoryLabel: `@ttoss/${package}`,
          },
          excludeExternals: true,
        },
      ];
    }),
  ],

and packages versions:

"docusaurus-plugin-typedoc": "^0.19.1",
"typedoc": "^0.24.4",
"typedoc-plugin-markdown": "^3.15.2",

How to reproduce

  1. Clone ttoss/ttoss
  2. Run pnpm i on monorepo root
  3. Uncomment // ui on docusaurus.config.js line 39
  4. Execute pnpm turbo run build --filter=@docs/website on monorepo root

Note

If we comment all packages except ui, the build works:

[
  // 'config',
  // 'forms',
  // 'i18n-cli',
  // 'react-i18n',
  'ui',
]

PS.: thanks for typedoc-plugin-markdown project :pray:

tgreyuk commented 1 year ago

Thanks for the info. Can you please update to docusaurus-plugin-markdown@19.0.2 and try again?

arantespp commented 1 year ago

Thanks @tgreyuk! It's working now.