You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeDoc exiting with unexpected error:
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert(params.length === 1)
at Object.convertType (/home/user/src/andcetera/node_modules/typedoc/dist/lib/converter/types.js:96:9)
at Object.convertType (/home/user/src/andcetera/node_modules/typedoc/dist/lib/converter/types.js:80:34)
at Converter.convertType (/home/user/src/andcetera/node_modules/typedoc/dist/lib/converter/converter.js:55:24)
at /home/user/src/andcetera/node_modules/typedoc/dist/lib/converter/factories/signature.js:47:33
at Array.map (<anonymous>)
at convertTypeParameters (/home/user/src/andcetera/node_modules/typedoc/dist/lib/converter/factories/signature.js:43:79)
at Object.createSignature (/home/user/src/andcetera/node_modules/typedoc/dist/lib/converter/factories/signature.js:20:29)
at Object.convertFunctionOrMethod (/home/user/src/andcetera/node_modules/typedoc/dist/lib/converter/symbols.js:158:39)
at Object.convertSymbol (/home/user/src/andcetera/node_modules/typedoc/dist/lib/converter/symbols.js:75:79)
at Converter.convertExports (/home/user/src/andcetera/node_modules/typedoc/dist/lib/converter/converter.js:157:23) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '=='
}
Steps to reproduce the bug
Note: I’m using TypeScript in JavaScript, but the bug is also reproducible in TypeScript (i.e. function foo<T extends unknown[]>()):
/** * Take any number of iterators, and zip them together into one iterator of * tuples. Closes after the shortest of the inputs closes. * * @template {unknown[]} A Tuple type with item type of each input iterator * @param {{ [K in keyof A]: Iterable<A[K]> }} items The iterators to be zipped * @returns {Iterable<A>} */exportdefaultfunction*zip(...items){constiters=items.map((item)=>item[Symbol.iterator]());letbuffer=iters.map((iter)=>iter.next());while(!buffer.some(({ done })=>done)){yield/** @type {A} */(buffer.map(({ value })=>value));buffer=iters.map((iter)=>iter.next());}}
This is.... really weird. The assert seems reasonable to me, and most of the time it works properly. The only time it doesn't appears to be when the array is in a constraint of a type parameter. Fixed in beta 25, and I've reached out of to some of the compiler team to see if they can enlighten me as to why an array has more than one type argument...
Search terms
Expected Behavior
Docs should be generated without errors
Actual Behavior
Docs are not generated with the following error:
Error output
Steps to reproduce the bug
Note: I’m using TypeScript in JavaScript, but the bug is also reproducible in TypeScript (i.e.
function foo<T extends unknown[]>()
):Write a function that uses a constraint generic type parameter (i.e.
@template {Constraint} T
):src/combinators/zip.js
Try to generate the docs:
See the error above.
tsconfig.json
Environment
The text was updated successfully, but these errors were encountered: