microsoft / dts-gen

dts-gen creates starter TypeScript definition files for any module or library.
MIT License
2.43k stars 101 forks source link

Need null checking in isClasslike (index.js) #98

Open gregemerson opened 6 years ago

gregemerson commented 6 years ago

TypeError: Cannot read property 'prototype' of null at isClasslike (C:\Users\amaza\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:110:18) at getKeysOfObject.some.k (C:\Users\amaza\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:43:57) at Array.some (native) at hasCloduleProperties (C:\Users\amaza\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:43:31) at getValueTypes (C:\Users\amaza\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:29:37) at getResult (C:\Users\amaza\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:188:55) at getTopLevelDeclarations (C:\Users\amaza\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:125:17) at getResult (C:\Users\amaza\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:150:17) at getTopLevelDeclarations (C:\Users\amaza\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:125:17) at Object.generateModuleDeclarationFile (C:\Users\amaza\AppData\Roaming\npm\node_modules\dts-gen\bin\lib\index.js:51:19)

Waog commented 6 years ago

Same problem here:

C:\myProject>dts-gen -m node-restful
Unexpected crash! Please log a bug with the commandline you specified.
C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\run.js:130
        throw e;
        ^

TypeError: Cannot read property 'prototype' of undefined
    at isClasslike (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\index.js:108:19)
    at getKeysOfObject.some.k (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\index.js:41:41)
    at Array.some (<anonymous>)
    at hasCloduleProperties (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\index.js:41:31)
    at getValueTypes (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\index.js:29:37)
    at getResult (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\index.js:186:55)
    at getTopLevelDeclarations (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\index.js:123:17)    at getResult (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\index.js:191:35)
    at getTopLevelDeclarations (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\index.js:123:17)    at Object.generateModuleDeclarationFile (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\index.js:49:19)
    at Object.<anonymous> (C:\aPath\nvm\v8.10.0\node_modules\dts-gen\bin\lib\run.js:57:24)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)