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

Cannot generate docs when "composite" is true in tsconfig.json #851

Closed
hassankhan opened this issue Sep 2, 2018 · 4 comments
Closed

Cannot generate docs when "composite" is true in tsconfig.json #851

hassankhan opened this issue Sep 2, 2018 · 4 comments
Labels
bug Functionality does not match expectation help wanted Contributions are especially encouraged needs reproduction Needs a minimal reproducible case

Comments

@hassankhan
Copy link

hassankhan commented Sep 2, 2018

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

@aciccarello aciccarello added bug Functionality does not match expectation help wanted Contributions are especially encouraged Priority: 2 labels Sep 3, 2018
@aciccarello
Copy link
Collaborator

Thanks for the report!

@izatop
Copy link

izatop commented Nov 25, 2019

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"]
}

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 2, 2019

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.

@curiouscod3
Copy link

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

@Gerrit0 Gerrit0 closed this as completed Nov 28, 2020
@Gerrit0 Gerrit0 added the needs reproduction Needs a minimal reproducible case label Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation help wanted Contributions are especially encouraged needs reproduction Needs a minimal reproducible case
Projects
None yet
Development

No branches or pull requests

5 participants