Flow-for-vscode: Highlighting not working

Created on 24 Jan 2017  路  8Comments  路  Source: flowtype/flow-for-vscode

Flow checking stopped working after I had to remove all node versions from my Mac (brew + nvm versions) and installed 5.12.0 with nvm.

Flow is installed globally and locally, and the flow check command works fine.

This is what I've found in the Flow output:

[2017-01-24T07:07:28.301Z] [ERROR] flow - Invalid JSON result from flow status --json /Users/janos/Documents/works/.../Main.js. JSON:
''.

Any idea what may be wrong here?

Most helpful comment

It seems that the problem is not related to the actual content (changing the .flowconfig restarts the flow server and that helps). When VSCode exits, it leaves the flow server running, and this is causing the problem the next time you start VSCode.

All 8 comments

Noticed that when I run 'flow check' it works fine, however, 'flow' without any parameters outputs the below message and it doesn't seem to complete:

flow is still initializing; this can take some time. [local inference] |

I understand this is the reason why the vscode flow plugin gets an empty JSON, so this is the root cause, however I can't say I understand why flow is doing this.

Just solved the issue, by reverting to original facebook .flowconfig file (it's a React Native project). I had replaced that with an empty one, trying to fix this issue, but now reverting back to that seems to have done trick. Clearly flow could do a better job at error reporting...

It seems that the problem is not related to the actual content (changing the .flowconfig restarts the flow server and that helps). When VSCode exits, it leaves the flow server running, and this is causing the problem the next time you start VSCode.

Not sure if it's VSCode or plugin issue, please advise.

@jarecsni Can you check flow versions that is used for Extension and in your terminal? If it's not the same you can receive situations with old flow version that used for extension are incompatible with extension. So please update flow that used for extension.

If you need old version, because new is not working for you, you can specify version in flowconfig, for example:

[version]
0.22.0

Thanks, I'm using another plugin at the moment, however, will give this a try too.

I think it's a versioning issue.
make sure that flow version you installed globally exactly matches the version specified in your project .flowconfig
it is a bit bizarre that I installed [email protected] today while has

[version]
^0.46.0

specified in my .flowconfig and this makes this extension keeps reporting
Invalid JSON result from flow status --json xxxxx

when the version mismatches, flow status --json .... outputs

$ flow status --json ~/playground
Launching Flow server for /data/users/mroch/playground
Wrong version of Flow. The config specifies version ^0.46.0 but this is version 0.47.0
Could not start Flow server!

which is obviously not JSON :)

I filed https://github.com/facebook/flow/issues/4038

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ajhyndman picture ajhyndman  路  4Comments

wbinnssmith picture wbinnssmith  路  5Comments

booboothefool picture booboothefool  路  4Comments

dominictwlee picture dominictwlee  路  5Comments

peterschussheim picture peterschussheim  路  5Comments