Skip to content

Error TS5053 about 'noEmit' when noEmit isn't configured #1716

@fenomas

Description

@fenomas

Search terms

TS5053, emitDeclarationOnly, noEmit

Expected Behavior

I'm building docs for a JS project, which uses tsc to emit type declarations, but not to compile anything. I'm invoking typedoc with the same config file, and things worked without errors under typedoc 0.20.

Actual Behavior

After updating typedoc to 0.22, when I run it I get the following error about noEmit, even though my configuration doesn't include that option.

Error: error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'.

Steps to reproduce the bug

This is on OSX, node 16.8.0. My package versions are current as of today:

        "typedoc": "^0.22.4",
        "typescript": "^4.4.3",

And I'm running npx typedoc in a folder containing the following tsconfig.json:

{
    "include": [ "src/index.js" ],
    "compilerOptions": {
        "outDir": "./dist",
        "target": "es5",
        "declaration": true,
        "emitDeclarationOnly": true,
        "allowJs": true,
        "lib": [ "DOM", "DOM.Iterable", "ES2018" ]
    },
    "typedocOptions": {
        "entryPoints": [ "src/index.js" ]
    }
}

The JS code doesn't seem to be relevant - the error displays even if the entry point file contains nothing but comments.

Has something changed here from previous versions? I can avoid the error by removing the "emitDeclarationOnly": true, config option, but since I'm not using tsc as a compiler this would mean I'd need separate configs for tsc and typedoc. Is that the solution here?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueEasier issue for first time contributorshelp wantedContributions are especially encouraged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions