Flow-for-vscode: Flow errors disappear a few seconds after opening VSCode

Created on 9 Sep 2017  路  4Comments  路  Source: flowtype/flow-for-vscode

The server seems to quickly stop itself? I am not sure "incorrect version" it is talking about. My .flowconfig matches my flow-bin version.

[2017-09-09T13:26:17.714Z] [INFO] flow - Path to Flow: flow
[2017-09-09T13:26:19.207Z] [INFO] flow - [unknown]: Flow server in /Users/a/hero/hero-server
[2017-09-09T13:26:19.267Z] [INFO] flow - Killed flow server with incorrect version in
[2017-09-09T13:26:19.267Z] [INFO] flow - [not running]: Flow server in /Users/a/hero/hero-server
[2017-09-09T13:26:21.326Z] [INFO] flow - [init]: Flow server in /Users/a/hero/hero-server
[2017-09-09T13:26:27.457Z] [INFO] flow - Killed flow server with incorrect version in
[2017-09-09T13:26:27.458Z] [INFO] flow - [not running]: Flow server in /Users/a/hero/hero-server
[2017-09-09T13:26:43.471Z] [INFO] flow - Killed flow server with incorrect version in
[2017-09-09T13:27:03.537Z] [INFO] flow - Killed flow server with incorrect version in
[2017-09-09T13:27:13.557Z] [ERROR] flow - Invalid JSON result from flow status --json /Users/a/hero/hero-server/src/index.js. JSON:
''.
[2017-09-09T13:29:52.575Z] [INFO] flow - [init]: Flow server in /Users/a/hero/hero-server
[2017-09-09T13:30:03.640Z] [INFO] flow - Killed flow server with incorrect version in
[2017-09-09T13:30:03.640Z] [INFO] flow - [not running]: Flow server in /Users/a/hero/hero-server
[2017-09-09T13:30:43.742Z] [INFO] flow - Killed flow server with incorrect version in
[2017-09-09T13:30:43.743Z] [ERROR] flow - Invalid JSON result from flow status --json /Users/a/hero/hero-server/src/index.js. JSON:
''.

Settings:

  "flow.enabled": true,
  "flow.runOnEdit": true,
  "flow.showStatus": true,
  "flow.runOnAllFiles": true,
  "flow.stopFlowOnExit": true,
  "flow.useNPMPackagedFlow": true

I am able to run flow in terminal with no issues.

UPDATE:
My project is setup like this:

/root
    /client
        .flowconfig
    /server
        .flowconfig

I noticed if I enter VSCode in /client or /server then Flow works, but not /root. What am I missing? It works fine if I open 2 separate windows for each directory.

Most helpful comment

@booboothefool @gmaggess
Found the cause of this issue. If the previous flow server was not successfully stopped and trying to start a new flow server will trigger this issue. You can run flow command directly under the project root directory to find out.

The solution is to

  1. Close vscode, make sure it won't try to start flow server again and again.
  2. Kill all the flow server processes using ps or Activity Monitor if you are on Mac
  3. Relauch vscode, you should all good to go.

Please let me know if it works for you.

All 4 comments

It doesn't seem to work on monorepo. I have the same issue.

+1 experience the same issue

@booboothefool @gmaggess
Found the cause of this issue. If the previous flow server was not successfully stopped and trying to start a new flow server will trigger this issue. You can run flow command directly under the project root directory to find out.

The solution is to

  1. Close vscode, make sure it won't try to start flow server again and again.
  2. Kill all the flow server processes using ps or Activity Monitor if you are on Mac
  3. Relauch vscode, you should all good to go.

Please let me know if it works for you.

Huh looks like this workaround helped me to resolve issue.. but would be good to have proper solution - it happening a lot of that Flow just hangs there afte closing VSCode and computer starts heating... :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

FezVrasta picture FezVrasta  路  5Comments

thymikee picture thymikee  路  6Comments

tomitrescak picture tomitrescak  路  7Comments

yurtaev picture yurtaev  路  3Comments