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

mkdirp race condition #184

Closed
zanemcca opened this issue Nov 22, 2018 · 4 comments
Closed

mkdirp race condition #184

zanemcca opened this issue Nov 22, 2018 · 4 comments

Comments

@zanemcca
Copy link

I have an error that pops up from time to time due to a missing directory.

Error Message

{ Error: ENOENT: no such file or directory, open 'generated/search.ts'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.writeFileSync (fs.js:1299:33)
    at /builds/atbinnovation/datalake/search/node_modules/graphql-binding/src/bin.ts:61:6
    at step (/builds/atbinnovation/datalake/search/node_modules/graphql-binding/dist/bin.js:41:23)
    at Object.next (/builds/atbinnovation/datalake/search/node_modules/graphql-binding/dist/bin.js:22:53)
    at /builds/atbinnovation/datalake/search/node_modules/graphql-binding/dist/bin.js:16:71
    at new Promise (<anonymous>)
    at __awaiter (/builds/atbinnovation/datalake/search/node_modules/graphql-binding/dist/bin.js:12:12)
    at run (/builds/atbinnovation/datalake/search/node_modules/graphql-binding/dist/bin.js:81:12)
    at Object.<anonymous> (/builds/atbinnovation/datalake/search/node_modules/graphql-binding/src/bin.ts:40:1)
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'generated/search.ts' }

I believe this line https://github.com/graphql-binding/graphql-binding/blob/master/src/bin.ts#L60 is to blame. It should probably be mkdirp.sync(...) instead of just mkdirp

@maticzav
Copy link
Collaborator

@zanemcca thank you for noticing this! Just added types and pushed changes. Let me know if it works 🙂

@schickling
Copy link
Contributor

🎉 This issue has been resolved in version 2.3.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@zanemcca
Copy link
Author

@maticzav Thanks for the quick fix!

It looks like that fixed it for me. I tested it 25 times locally and once on my CI and it passed every time. I will report back here if it pops back up again.

@maticzav
Copy link
Collaborator

@zanemcca great! I think it should work! Once I added types, the linter warned about the missing callbacks with no sync option. Curious why they weren't there before. 🤔

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

3 participants