Duplicate my problem here
https://github.com/flowtype/flow-bin/issues/150
Flow version: 0.93.0
windows 7 x64
.flowconfig
[include]
<PROJECT_ROOT>/src/.*
[options]
module.file_ext=.js
src/test.js
const b:number = "string";
package.json :
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"npm": "^6.8.0"
},
"devDependencies": {
"flow-bin": "^0.93.0"
}
}
Error in Terminal
Launching Flow server for C:\projects\test
Spawned flow server (pid=5696)
Logs will go to C:\Users\836D~1\AppData\Local\Temp\flow\CzCzBprojectszBtest.log
Monitor logs will go to C:\Users\836D~1\AppData\Local\Temp\flow\CzCzBprojectszBtest.monitor_log
鈫怺0KLaunching Flow server for C:\projects\testes remaining): /|
Spawned flow server (pid=7296)
Logs will go to C:\Users\836D~1\AppData\Local\Temp\flow\CzCzBprojectszBtest.log
Monitor logs will go to C:\Users\836D~1\AppData\Local\Temp\flow\CzCzBprojectszBtest.monitor_log
鈫怺0KLaunching Flow server for C:\projects\testes remaining): -/
Spawned flow server (pid=5208)
Logs will go to C:\Users\836D~1\AppData\Local\Temp\flow\CzCzBprojectszBtest.log
Monitor logs will go to C:\Users\836D~1\AppData\Local\Temp\flow\CzCzBprojectszBtest.monitor_log
鈫怺0KLaunching Flow server for C:\projects\testes remaining): -
Spawned flow server (pid=7252)
Logs will go to C:\Users\836D~1\AppData\Local\Temp\flow\CzCzBprojectszBtest.log
Monitor logs will go to C:\Users\836D~1\AppData\Local\Temp\flow\CzCzBprojectszBtest.monitor_log
鈫怺0KLost connection to the flow server (0 retries remaining): -Out of retries, exiting!
\AppData\Local\Temp\flow\CzCzBprojectszBtest.monitor_log :
C:\projects\test\node_modules\flow-bin\flow-win64-v0.93.0\flow.exe server C:/projects/test
Feb 27 12:22:17.684 [info] argv=C:\projects\test\node_modules\flow-bin\flow-win64-v0.93.0\flow.exe server C:/projects/test
Feb 27 12:22:17.684 [info] Creating a new Flow server
[2019-02-27 12:22:17.806] Uncaught async exception. Exiting
Exception: Unix.Unix_error(Unix.EPIPE, "write", "")
Backtrace:
Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 648, characters 38-65
Called from file "src/unix/lwt_unix.cppo.ml", line 563, characters 17-28
Re-raised at file "src/monitor/flowServerMonitorServer.ml", line 414, characters 4-738
Re-raised at file "src/monitor/flowServerMonitorServer.ml", line 597, characters 4-256
Re-raised at file "hack/utils/exception.ml", line 31, characters 2-45
Called from file "src/core/lwt.ml", line 2183, characters 23-28
Uncaught async exception: Unix.Unix_error(Unix.EPIPE, "write", "")
Raised by primitive operation at file "src/unix/lwt_unix.cppo.ml", line 648, characters 38-65
Called from file "src/unix/lwt_unix.cppo.ml", line 563, characters 17-28
Re-raised at file "src/monitor/flowServerMonitorServer.ml", line 414, characters 4-738
Re-raised at file "src/monitor/flowServerMonitorServer.ml", line 597, characters 4-256
Re-raised at file "hack/utils/exception.ml", line 31, characters 2-45
Called from file "src/core/lwt.ml", line 2183, characters 23-28
Disconnected
Help me please.
It's likely caused by something in your .flowconfig. Please provide the contents. You can also see if it works with a fresh .flowconfig, and narrow it down by removing a line at a time until you find out what's causing the crash.
Both Flow 0.93.0 and 0.92.0 are not compatible with styled-components. You need to use 0.91.0 or you'll get an error every time that you'll do something like:
${props => props.theme.something}
Also in Flow 0.91.0 styled-components support is limited and you can't use attr and optional props.
I'll post a workaround for the 2nd problem.
@Ziv-Barber As mentioned in #7525, that's an issue with the styled-component libdef in flow-typed not meeting the stricter typing requirements of Flow 0.92.
It's unrelated to this issue about Flow crashing in a project without styled-components as a project dependency.
I try add fresh .flowconfig, but it's not help. Whatever I add to .flowconfig, it's all the same
Added information about the test environment, and renamed the task so as not to be confusing, since this error behavior applies to older versions of flow
I had the very same problem. Unix.Unix_error(Unix.EPIPE, "write", "") on strange places... downgraded flow-bin from 0.94.0 to 0.91.0 - same problem. Then I fixed it by adding existing directory to [include] part of .flowconfig (file was copied from another project)
upgraded back to 0.94.0 - worked....... There should be some kind of test - no directories found - do not start checking that will fail...
@RadimZastera Nice find, looks like including a nonexistent directory under [include] does indeed causes a crash on Windows (but fine on other platforms).
Also causes a crash if you try something like <PROJECT_ROOT>/src in [include], even when that directory exists. Although could just be that <PROJECT_ROOT> is not meant to be supported anywhere outside [ignore], so the invalid path just gets ignored on other platforms.
However, this sounds like it's actually a different issue to what @Vadimzem is experiencing (as he mentioned an empty flowconfig). And different stack trace:
Unhandled exception: Unix.Unix_error(Unix.EPIPE, "write", "")
Raised at file "src/common/profiling/profiling_js.ml", line 421, characters 2-214
Re-raised at file "src/common/profiling/profiling_js.ml", line 421, characters 2-214
Re-raised at file "src/server/server.ml", line 42, characters 2-1023
Re-raised at file "src/server/server.ml", line 230, characters 4-130
Re-raised at file "src/server/server.ml", line 249, characters 6-215
Re-raised at file "src/server/server.ml", line 246, characters 4-505
Re-raised at file "src/core/lwt.ml", line 3008, characters 20-29
Called from file "src/unix/lwt_main.ml", line 42, characters 8-18
Called from file "src/server/server.ml", line 265, characters 6-54
Never mind, pretty sure it is the same issue. I was looking at a different log, and looking at the initial sample flowconfig provided, it will be because <PROJECT_ROOT> was under [include].
(You don't need anything under [include] really, it already scans the project root directory).
I've been doing some small patches around Windows support recently, so will see if I can address this one too.
@jamesisaac Thank you. That solve my problem. I am very grateful to you.
Glad to hear it :).
Let's keep this issue open though to track the bug. It shouldn't be crashing just because the folder doesn't exist... it works on other OSs.
I've been getting a crash with the same Backtrace as @Vadimzem when starting the server with flow status from Bash (from a Git for Windows installation) like this:
node node_modules/flow-bin/cli.js
No crash when using cmd instead of bash and no crash when running flow.exe directly instead of cli.js.
Can't reproduce
@goodmind there is no issue with running flow check, see my previous comment.