glutinum-org / cli

https://glutinum.net/
59 stars 6 forks source link

Crash when trying to read a type which resolves to `Partial<unknown>` #103

Closed joprice closed 4 months ago

joprice commented 4 months ago

When trying to generate code for yargs

./cli.js ../bindings/node_modules/@types/yargs/index.d.ts --out-file ../bindings/Yargs.fs

The following error is thrown:

file:///Users/dev/glutinum-cli/dist/Glutinum.Converter/Reader/TypeNode.js:92
                            if (symbol_1.members == null) {
                                         ^

TypeError: Cannot read properties of undefined (reading 'members')
    at readTypeNode (file:///Users/dev/glutinum-cli/dist/Glutinum.Converter/Reader/TypeNode.js:92:42)
    at Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2 (file:///Users/dev/glutinum-cli/dist/Glutinum.Converter/Reader/TypeScriptReader.js:69:84)
    at file:///Users/dev/glutinum-cli/dist/Glutinum.Converter/Reader/Parameters.js:8:198
    at file:///Users/dev/glutinum-cli/dist/fable_modules/fable-library-js.4.14.0/List.js:581:34
    at fold (file:///Users/dev/glutinum-cli/dist/fable_modules/fable-library-js.4.14.0/List.js:363:15)
    at map (file:///Users/dev/glutinum-cli/dist/fable_modules/fable-library-js.4.14.0/List.js:580:18)
    at readParameters (file:///Users/dev/glutinum-cli/dist/Glutinum.Converter/Reader/Parameters.js:6:12)
    at Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadParametersZ17143B5B (file:///Users/dev/glutinum-cli/dist/Glutinum.Converter/Reader/TypeScriptReader.js:81:16)
    at readDeclaration (file:///Users/dev/glutinum-cli/dist/Glutinum.Converter/Reader/Declaration.js:26:164)
    at Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadDeclaration61B89E55 (file:///Users/dev/glutinum-cli/dist/Glutinum.Converter/Reader/TypeScriptReader.js:77:16)