Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-existant file gives 'length' of undefined error #113

Open
SebastienGllmt opened this issue May 9, 2020 · 0 comments
Open

Non-existant file gives 'length' of undefined error #113

SebastienGllmt opened this issue May 9, 2020 · 0 comments

Comments

@SebastienGllmt
Copy link
Contributor

repro

{
  "scripts": {
    "flowgen": "flowgen fileThatDoesNotExist.d.ts"
  },
  "dependencies": {
  },
  "devDependencies": {
    "flowgen": "^1.10.0",
    "typescript": "3.8.3"
  }
}

running npm run flowgen results in this error

(node:18282) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
    at createSourceFile (/home/proj/node_modules/typescript/lib/typescript.js:19298:110)
    at parseSourceFileWorker (/home/proj/node_modules/typescript/lib/typescript.js:19231:26)
    at Object.parseSourceFile (/home/proj/node_modules/typescript/lib/typescript.js:19102:26)
    at createSourceFile (/home/proj/node_modules/typescript/lib/typescript.js:18925:29)
    at Object.compilerHost.getSourceFile (/home/proj/node_modules/flowgen/lib/cli/compiler.js:106:42)
    at findSourceFile (/home/proj/node_modules/typescript/lib/typescript.js:99293:29)
    at /home/proj/node_modules/typescript/lib/typescript.js:99170:85
    at getSourceFileFromReferenceWorker (/home/proj/node_modules/typescript/lib/typescript.js:99137:34)
    at processSourceFile (/home/proj/node_modules/typescript/lib/typescript.js:99170:13)
    at processRootFile (/home/proj/node_modules/typescript/lib/typescript.js:98993:13)

Should probably be a user-friendly error saying no file was found with that name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant