Typedoc: Warnings when building doc

Created on 3 Mar 2021  路  7Comments  路  Source: TypeStrong/typedoc

Search terms

Failed to convert type node with kind

Expected Behavior

I expected the documentation to be generated with no errors.

Actual Behavior

Warning: Failed to convert type node with kind: JSDocNullableType and text Element?. Please report a bug.

Steps to reproduce the bug

Create a *.d.ts file with the following function definition and attempt to generate documentation against it.

export function overlay(action:string, options:object?, element:Element?): any;

typedoc.json

{
    "disableSources": true,
    "exclude":
    [
        ...
    ],
    "excludePrivate": true,
    "excludeProtected": true,
    "includeVersion":  true,
    "entryPoints": ["./src"],
    "name": "...",
    "out": "docs",
    "readme":  "readme.txt"
}

Environment

  • Typedoc version: 0.20.28
  • TypeScript version: 4.1.5
  • Node.js version: 14.16.0
  • NPM version: 6.14.0
  • OS: Windows 10
bug

All 7 comments

What does your tsconfig look like? When I try this out, I get a compiler error from TypeScript before TypeDoc does anything.

Node.js version: 6.14.10

I'm also surprised we don't crash, node 6 is ancient, and not supported.

Node.js version: 6.14.10

I'm also surprised we don't crash, node 6 is ancient, and not supported.

Looks like I was giving the NPM version, not the Node.JS version... Whoops!

What does your tsconfig look like? When I try this out, I get a compiler error from TypeScript before TypeDoc does anything.

{ "compileOnSave": true, "compilerOptions": { "target": "es5", "module": "amd", "esModuleInterop": true, "lib": [ "es6", "dom" ], "sourceMap": true, "allowJs": false, "jsx": "react", "jsxFactory": "tsx", "experimentalDecorators": true, "moduleResolution": "node", "rootDir": "src", "forceConsistentCasingInFileNames": true, "importHelpers": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "noUnusedLocals": false, "strictNullChecks": true, "preserveConstEnums": true, "suppressImplicitAnyIndexErrors": true, "skipLibCheck": true, "outDir": "dist/scripts" }, "include": [ "./src/**/*", ], "exclude": [ "config", "node-modules", ] }

Oh, well, that's why...

    "skipLibCheck": true,

If you turn this off, then TypeScript will properly report this ill-formed declaration file as an error. I'm tempted to "fix" this by forcing that option to be false when compiling... but I'm going to sleep on it before making that decision.

Alright... after some thought, I'm not going to force this option to true. However, this is a tentative decision and may be reversed later if the maintenance burden proves to be too high.

  1. skipLibCheck poses many of the same problems as TypeDoc's removed ignoreCompilerErrors option, but in a less invasive way.
  2. The TypeScript docs recommend setting this property

Fixed in 0.20.30

Was this page helpful?
0 / 5 - 0 ratings