microsoft / dts-gen

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

Command line always crashes 0.4.20 & 0.4.19 #33

Open Jason3S opened 7 years ago

Jason3S commented 7 years ago

One of the library dependencies is causing dts-gen to crash.

Steps to Reproduce.

npm install -g dts-gen@0.4.20
dts-gen

or

npm install -g dts-gen@0.4.19
dts-gen

results 0.4.20

Unexpected crash! Please log a bug with the commandline you specified.
/usr/local/lib/node_modules/dts-gen/bin/lib/run.js:109
        throw e;
        ^

Error
    at new ArgsError (/usr/local/lib/node_modules/dts-gen/bin/lib/run.js:25:28)
    at Object.<anonymous> (/usr/local/lib/node_modules/dts-gen/bin/lib/run.js:39:15)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:418:7)
    at startup (bootstrap_node.js:139:9)

Extra Info

OS: Mac OS X 10.12.3 Node: 7.5.0 NPM: 4.2.0

I'll look to see if I can find the cause.

Jason3S commented 7 years ago

Changing the target to ES6 or ES2015 fixes the issue. But that means the browser stuff won't work.

Not Working:

{
    "include": [
        "lib",
        "tests"
    ],
    "compilerOptions": {
        "lib": [
            "es6",
            "dom"
        ],
        "module": "commonjs",
        "target": "es5",
        "noImplicitAny": true,
        "strictNullChecks": true,
        "sourceMap": true,
        "outDir": "./bin",
        "newLine": "LF"
    }
}

Working:

{
    "include": [
        "lib",
        "tests"
    ],
    "compilerOptions": {
        "lib": [
            "es2015",
            "dom"
        ],
        "module": "commonjs",
        "target": "es2015",
        "noImplicitAny": true,
        "strictNullChecks": true,
        "sourceMap": true,
        "outDir": "./bin",
        "newLine": "LF"
    }
}