typedoc-plugin-markdown icon indicating copy to clipboard operation
typedoc-plugin-markdown copied to clipboard

Type errors when building with docusaurus

Open xsorifc28 opened this issue 4 years ago • 2 comments
trafficstars

I'm using the docusaurus plugin and getting a plethora of type errors ( TS2305, TS2707 ).

It seems that typedoc-plugin-markdown is trying to resolve types inside node_modules/@types.

My project structure is like this:

src/(typescript code)
tsconfig.json
documentation (docusaurus folder)
-- tsconfig.json
-- (other docusaurus stuff)

Plugin configuration:

plugins: [
    [
      'docusaurus-plugin-typedoc',

      // Plugin / TypeDoc options
      {
        entryPoints: [
          '../src/list/of/files
        ],
        exclude: [ '../**/*.test.ts', '../node_modules'],
        tsconfig: '../tsconfig.json',
        readme: 'none',
        out: 'code-docs',
        sidebar: {
          cateboryLabel: 'Code Documentation',
          position: '3',
        },
      }
    ]

Example error:

Error: ../node_modules/@types/webpack/index.d.ts:32:3 - error TS2305: Module '"tapable"' has no exported member 'Tapable'.

I'm not sure why docusaurus-plugin-typedoc is referencing node_modules/@types/webpack/index.d.ts

xsorifc28 avatar Nov 04 '21 15:11 xsorifc28

Hi apologies for the delay. Is this still and issue - I have a suspicion that TypeDoc is trying to resolve those paths rather than the plugin. Is the code on public repo?

tgreyuk avatar Nov 12 '21 23:11 tgreyuk

The repo is not public. The issue is kind of random to reproduce - it goes away after a fresh npm install.

xsorifc28 avatar Nov 15 '21 04:11 xsorifc28