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

Warnings when building doc #1524

Labels
bug Functionality does not match expectation

Comments

@evanirla
Copy link

evanirla commented Mar 3, 2021

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
@evanirla evanirla added the bug Functionality does not match expectation label Mar 3, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 4, 2021

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

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 4, 2021

Node.js version: 6.14.10

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

@evanirla
Copy link
Author

evanirla commented Mar 4, 2021

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!

@evanirla
Copy link
Author

evanirla commented Mar 4, 2021

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

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 5, 2021

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.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 6, 2021

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

@Gerrit0 Gerrit0 closed this as completed in 34d05f2 Mar 6, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 6, 2021

Fixed in 0.20.30

This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment