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

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'file' of undefined #140

Open
compojoom opened this issue Apr 29, 2021 · 0 comments

Comments

@compojoom
Copy link

Hi,
I'm trying to export some flow definitions for this package:
https://github.com/notifee/react-native-notifee/tree/master/src

I have followed the readme and made a bash script:

#!/bin/zsh

for i in $(find react-native/dist -type f -name "*.d.ts");
  do sh -c "flowgen  $i -o ${i%.*.*}.js.flow";
done;

It works great - it goes through the file definitions and creates a js.flow file. However if I try to use the --flow-typed-format option:

#!/bin/zsh

for i in $(find react-native/dist -type f -name "*.d.ts");
  do sh -c "flowgen --flow-typed-format $i -o ${i%.*.*}.js.flow";
done;

I always run into the following error:

(node:41042) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'file' of undefined
    at Object.compile (~/.nvm/versions/node/v12.19.0/lib/node_modules/flowgen/lib/cli/runner.js:187:78)
    at Command.<anonymous> (~/.nvm/versions/node/v12.19.0/lib/node_modules/flowgen/lib/cli/index.js:25:6)
    at Command.listener [as _actionHandler] (~/.nvm/versions/node/v12.19.0/lib/node_modules/flowgen/node_modules/commander/index.js:426:31)
    at Command._parseCommand (~/.nvm/versions/node/v12.19.0/lib/node_modules/flowgen/node_modules/commander/index.js:1002:14)
    at Command.parse (~/.nvm/versions/node/v12.19.0/lib/node_modules/flowgen/node_modules/commander/index.js:801:10)
    at Object.<anonymous> (~/.nvm/versions/node/v12.19.0/lib/node_modules/flowgen/lib/cli/index.js:28:20)
    at Module._compile (internal/modules/cjs/loader.js:1015:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
(node:41042) 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: 1)
(node:41042) [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.

Am I doing something wrong here?

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