See it in action on a real package:
$ yarn init
$ yarn add [email protected]
$ yarn add [email protected]
$ touch .flowconfig
$ node_modules/.bin/flow
Launching Flow server for /home/jdscheff/projects/browserify-flow-bug/foo
Spawned flow server (pid=26513)
Logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.log
Monitor logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.monitor_log
Lost connection to the flow server (3 retries remaining)
Launching Flow server for /home/jdscheff/projects/browserify-flow-bug/foo
Spawned flow server (pid=26540)
Logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.log
Monitor logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.monitor_log
Lost connection to the flow server (2 retries remaining)
Launching Flow server for /home/jdscheff/projects/browserify-flow-bug/foo
Spawned flow server (pid=26557)
Logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.log
Monitor logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.monitor_log
Lost connection to the flow server (1 retry remaining)
Launching Flow server for /home/jdscheff/projects/browserify-flow-bug/foo
Spawned flow server (pid=26574)
Logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.log
Monitor logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.monitor_log
Lost connection to the flow server (0 retries remaining)
Out of retries, exiting!
$ echo "[ignore]" > .flowconfig
$ echo ".*/node_modules/module-deps/test/invalid_pkg/package.json" >> .flowconfig
$ node_modules/.bin/flow
Launching Flow server for /home/jdscheff/projects/browserify-flow-bug/foo
Spawned flow server (pid=26763)
Logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.log
Monitor logs will go to /tmp/flow/zShomezSjdscheffzSprojectszSbrowserify-flow-bugzSfoo.monitor_log
No errors!
Here is what that ignored file looks like:
"just a string"
Seems that the same thing happens when you have any file named package.json containing something like that.
I'm also going to submit a PR to module-deps to get them to stop putting tests in their npm package, but I figure it's a more general problem that you guys might want to look into.
a workaround is to add the conflictive file to the [ignore] section in the .flowconfig file:
<PROJECT_ROOT>/node_modules/browserify-middleware/.*/test/.*
That's what I did, for the file that was causing me problems. But it's very poor usability to force users to do that, especially when the error message doesn't tell you what file (or even what dependency) is causing the problem. It's not easy to find the offending file if you have many dependencies.
have the same issue with this dependency
Looks like this was fixed in https://github.com/facebook/flow/commit/f942d9676d174d3469ed532770934063518ce4f5
Most helpful comment
That's what I did, for the file that was causing me problems. But it's very poor usability to force users to do that, especially when the error message doesn't tell you what file (or even what dependency) is causing the problem. It's not easy to find the offending file if you have many dependencies.