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

Assert in convertProperty with ws type definitions #1463

Closed
Gerrit0 opened this issue Jan 12, 2021 · 1 comment
Closed

Assert in convertProperty with ws type definitions #1463

Gerrit0 opened this issue Jan 12, 2021 · 1 comment
Labels
bug Functionality does not match expectation

Comments

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 12, 2021

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

Gerrit0 commented Jan 12, 2021

CC: @d-fischer - reported via Discord

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
Projects
None yet
Development

No branches or pull requests

1 participant