microsoft / dts-gen

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

Crash with scoped package #153

Open martinmcwhorter opened 4 years ago

martinmcwhorter commented 4 years ago

I am getting a crash trying to generate definitions for a scoped package.

The command I run:

dts-gen -m @commitlint/load

/Users/martin.mcwhorter/.nvm/versions/node/v12.6.0/lib/node_modules/dts-gen/bin/lib/run.js:125
        throw e;
        ^

Error: ENOENT: no such file or directory, open '@commitlint/load.d.ts'
    at Object.openSync (fs.js:447:3)
    at Object.writeFileSync (fs.js:1206:35)
    at Object.<anonymous> (/Users/martin.mcwhorter/.nvm/versions/node/v12.6.0/lib/node_modules/dts-gen/bin/lib/run.js:107:12)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
    at internal/main/run_main_module.js:17:11 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '@commitlint/load.d.ts'
}
Mistic92 commented 4 years ago

I have the same issue for dts-gen -m @sfeir/actions-on-google-i18n

Mistic92 commented 4 years ago

I think this may be related to creating file on Windows. When I used -f my.d.ts it worked

martinmcwhorter commented 4 years ago

I am using macOs, bash shell.

On Mon 16 Mar 2020, 10:02 a.m. Łukasz Byjoś, notifications@github.com wrote:

I think this may be related to creating file on Windows. When I used -f my.d.ts it worked

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/dts-gen/issues/153#issuecomment-599447083, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJDT6T4TLAZ2BOXPEPBQYTRHX2JXANCNFSM4K4ECQDQ .

Naxos84 commented 3 years ago

Im having also the issue when trying to generate for @buffetjs/core

Command: dts-gen -m @buffetjs/core

Error-stack:

Unexpected crash! Please log a bug with the commandline you specified.
C:\Users\${username}\AppData\Roaming\nvm\v12.16.0\node_modules\dts-gen\bin\lib\run.js:125
        throw e;
        ^
ReferenceError: window is not defined
    at Object.<anonymous> (C:\${PROJECT_PATH}\node_modules\@buffetjs\core\build\bundle.development.js:10:4)
    at Module._compile (internal/modules/cjs/loader.js:1157:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10) 
    at Module.load (internal/modules/cjs/loader.js:1001:32)
    at Function.Module._load (internal/modules/cjs/loader.js:900:14)
    at Module.require (internal/modules/cjs/loader.js:1043:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:\${PROJECT_PATH}\node_modules\@buffetjs\core\build\index.js:7:20)
    at Module._compile (internal/modules/cjs/loader.js:1157:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10) 

Note: I stripped username and project-path. Im using windows. And it could be that it is another issue since I get another stack trace then the issue creator. But I'm not sure. So I commented here instead of creating a new issue.