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
TypeError: Cannot read properties of undefined (reading 'map')
intersectionConverter
convertType
undefined map
Expected Behavior
Expected that typing typedoc from the CLI would generate documentation.
Actual Behavior
typedoc with this config throws the following error:
TypeDoc exiting with unexpected error:
TypeError: Cannot read properties of undefined (reading 'map')
at Object.convertType (/Users/ampower/Projects/personal/dataflow/node_modules/typedoc/dist/lib/converter/types.js:250:57)
at convertType (/Users/ampower/Projects/personal/dataflow/node_modules/typedoc/dist/lib/converter/types.js:96:34)
at /Users/ampower/Projects/personal/dataflow/node_modules/typedoc/dist/lib/converter/types.js:250:71
at Array.map ()
at Object.convertType (/Users/ampower/Projects/personal/dataflow/node_modules/typedoc/dist/lib/converter/types.js:250:57)
at convertType (/Users/ampower/Projects/personal/dataflow/node_modules/typedoc/dist/lib/converter/types.js:96:34)
at /Users/ampower/Projects/personal/dataflow/node_modules/typedoc/dist/lib/converter/types.js:404:109
at Array.map ()
at Object.convertType (/Users/ampower/Projects/personal/dataflow/node_modules/typedoc/dist/lib/converter/types.js:404:96)
at convertType (/Users/ampower/Projects/personal/dataflow/node_modules/typedoc/dist/lib/converter/types.js:96:34)
The error seems to be related Readable.ts file which implements the TypeScript mixin pattern. Looking at the thrown error, it seems that intersectionConverter.convertType() chokes that types doesn't contain a map. I don't see anything particularly esoteric about the types in the file that would lead to this.
Steps to reproduce the bug
Still working on a minimal reproduction. Will post when I manage to pull apart the code and still reproduce the bug.
Environment
Typedoc version: 0.23.8
TypeScript version: 4.7.4
Node.js version: v17.4.0
OS: MacOS Monterey 12.3.1
The text was updated successfully, but these errors were encountered:
In both of these cases, this is an intersection with two members, and the first member of the intersection is an object type, not an intersection type. This is because { abstract new (...args: any[]) => Reader } is not a valid type, since abstract cannot appear on type members.
Since TypeDoc uses typeToTypeNode (same function that the typeToString method uses) to get a type kind that can be mapped into a converter, this first member is then detected as an intersection, even though it isn't, and 💥
Adding this in the convertType fixes things... I really dislike it though
Search terms
TypeError: Cannot read properties of undefined (reading 'map')
Expected Behavior
Expected that typing
typedoc
from the CLI would generate documentation.Actual Behavior
typedoc
with this config throws the following error:The error seems to be related Readable.ts file which implements the TypeScript mixin pattern. Looking at the thrown error, it seems that
intersectionConverter.convertType()
chokes thattypes
doesn't contain a map. I don't see anything particularly esoteric about the types in the file that would lead to this.Steps to reproduce the bug
Still working on a minimal reproduction. Will post when I manage to pull apart the code and still reproduce the bug.
Environment
The text was updated successfully, but these errors were encountered: