While we now have an IDE integration with WebStorm, it really is quite bad.
There is one point that I assume is in Flow's court and not the IDEs fault, so (in addition to countless - and usually ignored - tickets I created in Jetbrains ticket system for WebStorm and Flow) I post it here.
Because looking at Flow results in WebStorm is a) unreliable (sometimes they show up, often they don't), b) information is missing (only the first half of the error message, for example, only line #1 but not what it says about line #2), I often run Flow on the command line.
Now, a simple "flow status" should be enough, right? After all, WebStorm already has a Flow server process running. _I assume though that that process suffers from the same problem._
The problem: Endless restarts!! Very rarely do I just get the current flow-status. In most cases I get "timeout, retry, restart, recheck", which takes forever. Sometimes I have to wait for "out of retries - error" to run it again to get a result.
Example:
$ flow
Launching Flow server for C:\Users\ME\Project
Spawned flow server (pid=6016)
Logs will go to C:\Users\ME\AppData\Local\Temp\flow\CzCzBUserszBMEzBProject.log
Launching Flow server for C:\Users\ME\Projects
Spawned flow server (pid=8992)
Logs will go to C:\Users\ME\AppData\Local\Temp\flow\CzCzBUserszBMEzBProject.log
The flow server is not responding (0 retries remaining): [processing] -
Out of retries, exiting!
Another example (it cycles between 4 or 5 different kinds of errors that all end in a new server being spawned - which doesn't last long before it too is replaced by the next one):
$ flow
Launching Flow server for C:\Users\ME\Project
Error: There is already a server running for C:\Users\ME\Project
Archive: flow.tar.gz
I run Flow from the command line and have the same issue
I run flow from the command line as well and am having the same issue, except mine just goes forever, never saying its out of retries.
OS: MacOS Sierra 10.12.3
Flow version: 0.39.0
Sometimes re-cloning the repo fixes it temporarily, but then it reappears. Makes it basically impossible to develop!
Same.
Launching Flow server for E:\Users\MegaMozg\code\github-issue-viewer-21-02-17
Spawned flow server (pid=9244)
Logs will go to E:\Users\MegaMozg\AppData\Local\Temp\flow\EzCzBUserszBMegaMozZgzBcodezBgithub-issue-viewer-21-02-17.log The flow server is not responding (0 retries remaining): [processing] /
Out of retries, exiting!
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "flow"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] flow: `flow`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the [email protected] flow script 'flow'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the github-issue-viewer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! flow
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs github-issue-viewer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls github-issue-viewer
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\Users\MegaMozg\code\github-issue-viewer-21-02-17\npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run-script',
1 verbose cli 'flow' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preflow', 'flow', 'postflow' ]
5 info lifecycle [email protected]~preflow: [email protected]
6 silly lifecycle [email protected]~preflow: no script for preflow, continuing
7 info lifecycle [email protected]~flow: [email protected]
8 verbose lifecycle [email protected]~flow: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~flow: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;E:\Users\MegaMozg\code\github-issue-viewer-21-02-17\node_modules\.bin;C:\Program Files\cmder\bin;C:\Program Files\cmder\vendor\git-for-windows\cmd;C:\Program Files\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\Program Files\cmder\vendor\conemu-maximus5;C:\Program Files\cmder\vendor\conemu-maximus5\ConEmu;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\nodejs\;C:\Program Files (x86)\scala\bin;C:\Program Files (x86)\sbt\bin;E:\Users\MegaMozg\AppData\Roaming\OCamlPro\OCPWin\wrappers;E:\Users\MegaMozg\AppData\Roaming\OCamlPro\OCPWin\4.01.0+ocp1-full-mingw64-20160113\bin;C:\Program Files (x86)\activator-dist-1.3.12\bin;E:\Users\MegaMozg\AppData\Local\atom;E:\Users\MegaMozg\AppData\Roaming\npm;C:\Program Files\cmder\vendor\git-for-windows\usr\bin;C:\Program Files\cmder\vendor\git-for-windows\usr\share\vim\vim74;C:\Program Files\cmder\
10 verbose lifecycle [email protected]~flow: CWD: E:\Users\MegaMozg\code\github-issue-viewer-21-02-17
11 silly lifecycle [email protected]~flow: Args: [ '/d /s /c', 'flow' ]
12 silly lifecycle [email protected]~flow: Returned: code: 7 signal: null
13 info lifecycle [email protected]~flow: Failed to exec flow script
14 verbose stack Error: [email protected] flow: `flow`
14 verbose stack Exit status 7
14 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:877:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd E:\Users\MegaMozg\code\github-issue-viewer-21-02-17
17 error Windows_NT 10.0.14393
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "flow"
19 error node v6.9.5
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error [email protected] flow: `flow`
22 error Exit status 7
23 error Failed at the [email protected] flow script 'flow'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the github-issue-viewer package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error flow
23 error You can get information on how to open an issue for this project with:
23 error npm bugs github-issue-viewer
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls github-issue-viewer
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Using (latest versions) Flow 0.51.0 and Webstorm 2017.2 on Windows 10: The ever-crashing and Flow service (and respawning by Webstorm takes time and doesn't even always work) takes all joy out of using that combination. I have to go to a console and run Flow to see what's up.
Using Flow 0.53.1 and WebStorm 2017.2.2 (latest), very often (80%?) when there is an error reported by Flow (in the code) Flow crashes and has to be respawned. Which WebStorm doesn't always do automatically and there is no indication that Flow is dead, but that is something Jetbrains has to solve. These near CONSTANT CRASHES make it near impossible to rely on with the IDE, I have to run it on the command line all the time to get any use from it.
There is no crash for as long as there is no (code) error, while the parse-status is "OK".
_PS: I'm happy to see that the ca. 1,500 open issues list only ever keeps growing, and that it is dwarfed by the 2,500 open issues for TypeScript... On the other hand, they have almost 11,000 close issues vs. 2,000 for Flow. Just an observation._
Yeah, I've heard from several other people that the WebStorm integration is problematic. Unfortunately, I think it's maintained by them, and they have said on twitter they have various custom behavior in the flow integration. I'm not sure if there's much we can do from here. They have said they are watching progress on the flow language server and hope to adopt new stuff as it's available.
(PS not true! There are actually fewer open issues than three days ago. I've spent a lot of the last three days combing through old issues to retry them on newer versions, mark them as fixed, or cross-link multiple reports of the same thing. As of now, only FB employees have the power to label/close issues, so it's a little slow for me to mark things and hope the original requestor closes them, but we're actually making progress.)
OT
@asolove As long as nobody gets paid for Flow related work nothing is going to change. Only the issues that Facebook projects benefit from have a "budget". That's such a general problem that I don't understand why companies like Github don't even seem to _try_ to address it. Hoping for individual contributions for individual projects won't work (neither will hoping for volunteer work for any sizable project, such as Flow). Very discouraging, actually.
I would not mind a discriminatory policy such as "you don't pay into the subscription pool for the 100,000 open source projects from which we get paid, your so your ticket is low priority". Basing it all on volunteerism and hoping for the best has limits. A lot of people needs this tools for "real" (commercial) projects, but we can't go and pay on an individual basis because the projects just are too numerous and too small.
Hey, doesn't Facebook have a huge worldwide community too and could look into this... (it would be more like Amazon doing cloud stuff, not core business when it's started but could grow)
At least it is good to say something like Limited support for Windows on flow web site.
I only run flow from the command line on windows 7, using yarn run flow
, and the server dies and needs to restart several times a day.
I've tried Flow on a number of Windows 10 machines, all exhibiting the same issue over the past year. I agree with @sagar12861. This is a pretty major issue and while it exists, any mention of Windows support should link to this issue to prevent people from wasting their time.
Are there any Windows users that have _not_ encountered this issue?
I also see this issue on windows.
For what its worth, I was experiencing the same flow server infinite restart issue on OSX (same as @corinnaerin above). Updating to latest version (v0.76) resolved this for me.
One thing to double-check, make sure you only have flow-bin specified in the root of your project and _not_ in any other sub-directory package.json files.
Try to disable "safe write" in WebStorm. This works for me. All flow crashes are gone after this. (And if I enabled it again there is a tons of crashes, for example, if the code is syntactically wrong for a moment) I think this problem raises from WebStorm too fast delete temporary files that's created for "safe write" purpose and something in flow itself (race condition). But it's only my assumption. This can help to manage https://github.com/facebook/flow/issues/6188 issue too. For CLI runs I don't have a solution. But to be precies I experienced flow crashes or the server cannot start only in old versions - somwhere in 0.4x.
Checked for flow 0.61 and 0.77
Hope this helps!
@Evalon 's method seems to work for me in IntelliJ IDEA 2018.1 IDE.
@Evalon 's method worked for me too. Now the server won't restart every few mins. Thanks @Evalon
For the record: Using the "safe write" Webstorm setting in Linux works just fine with Flow, crashes are very infrequent (I see one every few days or so), compared to near constant crashing on Windows.
@lll000111 is there any solution for Windows+Webstorm?
@Aziaev Yes: I switched to working in a Linux VM — and now I switched to TypeScript. Experience: There is no (other) technical reason to make that switch, I wanted to be "mainstream" and its easier to get the rest of the team to adopt types now. Apart from these crashes Flow is at least as good and a bit more strict, and TS is not any faster or "better" (external lib defs excluded, they are much easier to get).
With Pycharm I am still getting this problem, even if I turn off "safe write"
Most helpful comment
At least it is good to say something like Limited support for Windows on flow web site.