mattpocock / xstate-codegen

A codegen tool for 100% TS type-safety in XState
MIT License
245 stars 12 forks source link

xstate-codegen watcher fails if a matching directory name is found #38

Closed johnnydecimal closed 3 years ago

johnnydecimal commented 3 years ago

Silly me created a directory called newSignInState.machine.ts and the CLI watching my folder sh*t the bed. :-)

Watching for file changes in: src/**/**.machine.ts
File Added: src/machines/newSignInState.machine.ts
(node:58598) UnhandledPromiseRejectionWarning: Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (fs.js:578:3)
    at tryReadSync (fs.js:353:20)
    at Object.readFileSync (fs.js:390:19)
    at Gaze.<anonymous> (/Users/john/dev/app.johnnydecimal.com/node_modules/xstate-codegen/bin/index.js:115:60)
    at step (/Users/john/dev/app.johnnydecimal.com/node_modules/xstate-codegen/bin/index.js:45:23)
    at Object.next (/Users/john/dev/app.johnnydecimal.com/node_modules/xstate-codegen/bin/index.js:26:53)
    at /Users/john/dev/app.johnnydecimal.com/node_modules/xstate-codegen/bin/index.js:20:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/john/dev/app.johnnydecimal.com/node_modules/xstate-codegen/bin/index.js:16:12)
    at addToCache (/Users/john/dev/app.johnnydecimal.com/node_modules/xstate-codegen/bin/index.js:110:63)
(node:58598) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:58598) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
mattpocock commented 3 years ago

This is a good chance to try out the new error code frame, @Andarist?