Typedoc: Cannot generate docs when "composite" is true in tsconfig.json

Created on 2 Sep 2018  路  4Comments  路  Source: TypeStrong/typedoc

Bug Report

This bug is occurring in a monorepo project managed with Yarn Workspaces. I've recently upgraded it to TypeScript 3 and was looking to take advantage of Project References. To do this, I set composite: true under compilerOptions in tsconfig.json for each subpackage. If I set it to false, then everything works fine.

  • __TypeDoc version__: 0.12.0
  • __TypeScript version__: 3.0.1

Actual behavior

$ typedoc --out docs --target es6 --theme minimal --mode file src
Using TypeScript 3.0.1 from /[PROJECT_ROOT]/node_modules/typescript/lib
/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:14080
        return path.replace(backslashRegExp, ts.directorySeparator);
                    ^

TypeError: Cannot read property 'replace' of undefined
    at Object.normalizeSlashes (/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:14080:21)
    at getCommonSourceDirectory (/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:82737:68)
    at verifyCompilerOptions (/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:84278:27)
    at Object.createProgram (/[PROJECT_ROOT]/node_modules/typescript/lib/typescript.js:82703:9)
    at Converter.convert (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/converter/converter.js:109:26)
    at CliApplication.Application.convert (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/application.js:84:37)
    at CliApplication.bootstrap (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/cli.js:62:32)
    at CliApplication.Application [as constructor] (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/application.js:44:15)
    at new CliApplication (/[PROJECT_ROOT]/node_modules/typedoc/dist/lib/cli.js:38:42)
    at Object.<anonymous> (/[PROJECT_ROOT]/node_modules/typedoc/bin/typedoc:4:1)

Expected behavior

It should generate docs with no problems.

Similar issues

bug help wanted needs reproduction

Most helpful comment

I suspect this is at least related to #380, TypeDoc doesn't seem to support the extends option in tsconfig.json. I think fixing that should at least improve this.

All 4 comments

Thanks for the report!

I use typedoc programmatically and got same issue.

TypeScript crashes with following error(s):
File '/path/to/file.ts' is not listed within the file list of project ''. Projects must list all files or use an 'include' pattern.

My project and global TS configs are:

Project config

```{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"rootDir": "src",
"outDir": "build",
"strictPropertyInitialization": false,
"noUnusedParameters": false,
"allowUnusedLabels": true,
"noUnusedLocals": false
},
"include": [
"src"
],
"references": [
{
"path": "../reference"
}
]
}


**Global config**
```{
    "compilerOptions": {
        "target": "esnext",
        "module": "esnext",
        "lib": ["esnext"],
        "declaration": true,
        "importHelpers": true,
        "noEmitHelpers": true,
        "strict": true,
        "noImplicitAny": true,
        "strictNullChecks": true,
        "strictFunctionTypes": true,
        "strictBindCallApply": true,
        "strictPropertyInitialization": true,
        "noImplicitThis": true,
        "alwaysStrict": true,
        "noUnusedLocals": true,
        "noFallthroughCasesInSwitch": true,
        "allowSyntheticDefaultImports": true,
        "esModuleInterop": true,
        "forceConsistentCasingInFileNames": true,
        "newLine": "LF",
        "allowJs": false,
        "moduleResolution": "node",
        "skipLibCheck": true,
        "experimentalDecorators": true,
        "types": [],
        "composite": true,
        "incremental": true,
        "baseUrl": ".",
        "paths": {
            "@app/*": [
                "packages/*/src"
            ]
        }
    },
    "include": [],
    "exclude": ["node_modules"]
}

I suspect this is at least related to #380, TypeDoc doesn't seem to support the extends option in tsconfig.json. I think fixing that should at least improve this.

Typedoc doesn't support Solution style: "https://angular.io/config/solution-tsconfig".
Can't use with Angular 10.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cfischer picture cfischer  路  4Comments

euberdeveloper picture euberdeveloper  路  3Comments

mcmath picture mcmath  路  3Comments

Rycochet picture Rycochet  路  4Comments

woppa684 picture woppa684  路  3Comments