Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

VSCode highlights error but binary don't #442

Open
josemigallas opened this issue Aug 3, 2022 · 4 comments
Open

VSCode highlights error but binary don't #442

josemigallas opened this issue Aug 3, 2022 · 4 comments

Comments

@josemigallas
Copy link

I'm having a version conflict between VScode extension and npm package. An error is highlighted in the editor:
Screenshot 2022-08-03 at 11 51 30

but it's not picked up by the binary:

yarn flow spec/javascripts/Stats/applications_table.spec.js
yarn run v1.22.19
$ /Users/user/projects/3scale/porta/node_modules/.bin/flow spec/javascripts/Stats/applications_table.spec.js
No errors!

Here's the logs from the Output console:

[Info  - 12:01:07 PM - porta/.flowconfig] Found flow using option `pathToFlow`
[Info  - 12:01:10 PM - porta/.flowconfig] Using flow '/Users/user/projects/3scale/porta/node_modules/.bin/flow' (v0.152.0)

And here's my folder's config:

{
  "flow.useBundledFlow": false,
  "flow.useNPMPackagedFlow": false,
  "flow.pathToFlow": "${workspaceFolder}/node_modules/.bin/flow",
}

I can't reproduce it anymore, but at some point I managed to get this error in the Output console:

[Info  - 11:51:24 AM - porta/.flowconfig] restarting client
[Info  - 11:51:24 AM - porta/.flowconfig] Unable to verify SHASUM256.txt.sign:
ENOENT: no such file or directory, open '/Users/user/projects/3scale/porta/node_modules/flow-bin/SHASUM256.txt.sign'
[Info  - 11:51:24 AM - porta/.flowconfig] Found flow using option `useNPMPackagedFlow`
[Info  - 11:51:24 AM - porta/.flowconfig] Using flow '/Users/user/projects/3scale/porta/node_modules/flow-bin/flow-osx-v0.152.0/flow' (v0.152.0)
Flow: the running server is a newer version of Flow (0.183.0) than the LSP (0.152.0)LSP is exiting. Hopefully the IDE will start an LSP with the same binary as the server[Error - 11:51:33 AM] Connection to server got closed. Server will not be restarted.

My guess is that VScode is using Flow (0.183.0) somehow, picking up the error, whereas running flow doesn't. Any ideas how to further debug this?

@mroch
Copy link
Contributor

mroch commented Aug 3, 2022

is the file saved? yarn flow checks what's on disk, but vscode checks the unsaved file as you type.

as for why it tried to use 0.183: that's the version bundled with the extension. I'm guessing you hadn't run yarn yet, so node_modules/.bin/flow and node_modules/flow-bin/SHASUM256.txt didn't exist, so it fell back to the built-in version. since your pathToFlow is using the node module anyway, I'd suggest using useNPMPackagedFlow.

@romanlex
Copy link

romanlex commented Sep 20, 2022

I can confirm this issue but another case

  • VScode doesn't highlight errors
  • binary show many errors

Flow ver: 0.133
Flowtype extension: 2.2.0

  "flow.pathToFlow": "${workspaceFolder}/client/node_modules/.bin/flow",
  "flow.useBundledFlow": false,

I see errors in log with "flow.trace.server": "verbose" but error not highlighted in VScode
image

@mroch
Copy link
Contributor

mroch commented Sep 20, 2022

@romanlex that sounds like a different issue, please open a new one. but 0.133 is two years old (54 versions behind) so we can't really support that anymore.

@romanlex
Copy link

@mroch I open new issues #446
and I think what problem really exists

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants