Skip to content

Assert in convertProperty with ws type definitions #1463

@Gerrit0

Description

@Gerrit0

Search terms

declaration file, missing property

Expected Behavior

No assert for valid TS:

declare module '@d-fischer/isomorphic-ws' {
    import * as WebSocket from 'ws';

    export = WebSocket;
}

Actual Behavior

Crash:

> npx typedoc .\src\ws.ts
Debug: Arguments reader reading with: [".\\src\\ws.ts"]
Debug: Arguments reader reading with: [".\\src\\ws.ts"]
Debug: Using TypeScript 4.1.3 from C:\Users\gtbir\Documents\GitHub\typedoc-master\node_modules\typescript\lib
Debug: Converting with 1 programs
Debug: Begin readme search at C:\Users\gtbir\Desktop\library-tests\src
TypeDoc exiting with unexpected error:
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert(parentSymbol)

    at Object.convertProperty (C:\Users\gtbir\Documents\GitHub\typedoc-master\dist\lib\converter\symbols.js:265:5)
    at Object.convertSymbol (C:\Users\gtbir\Documents\GitHub\typedoc-master\dist\lib\converter\symbols.js:81:79)
    at Converter.convertReExports (C:\Users\gtbir\Documents\GitHub\typedoc-master\dist\lib\converter\converter.js:186:23)
    at Converter.compile (C:\Users\gtbir\Documents\GitHub\typedoc-master\dist\lib\converter\converter.js:161:18)
    at Converter.convert (C:\Users\gtbir\Documents\GitHub\typedoc-master\dist\lib\converter\converter.js:42:14)
    at Application.convert (C:\Users\gtbir\Documents\GitHub\typedoc-master\dist\lib\application.js:151:31)
    at run (C:\Users\gtbir\Documents\GitHub\typedoc-master\bin\typedoc:61:25)
    at Object.<anonymous> (C:\Users\gtbir\Documents\GitHub\typedoc-master\bin\typedoc:27:1)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: true,
  operator: '=='
}

Steps to reproduce the bug

yarn init -y
yarn add @types/ws typescript typedoc
npx tsc --init
vim src/index.ts # paste in content above
npx typedoc src/index.ts

Environment

  • Typedoc version: 0.20.14
  • TypeScript version: 4.1.3
  • Node.js version: 14
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions