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

Can't run flow in cmd when VS Code is open in Windows #260

Closed
edele opened this issue Jul 11, 2018 · 14 comments
Closed

Can't run flow in cmd when VS Code is open in Windows #260

edele opened this issue Jul 11, 2018 · 14 comments

Comments

@edele
Copy link

edele commented Jul 11, 2018

flow is running on a different directory.
server_root: c:\Users\edele\flowtest, client_root: C:\Users\edele\flowtest
  1. Open VS Code in any project, wait flow to initialize
  2. Run yarn run flow. It will fail with output:
C:\Users\edele\flowtest>yarn run flow
yarn run v1.7.0
$ C:\Users\edele\flowtest\node_modules\.bin\flow
flow is running on a different directory.
server_root: c:\Users\edele\flowtest, client_root: C:\Users\edele\flowtest
error Command failed with exit code 14.

I use cmd.exe in Windows 10.
I run flow in cmd to see all errors in a project, not just in open files.

Should it be fixed in flow-for-vscode extension or in flow-bin itself?
Is there a workaround?

@edele
Copy link
Author

edele commented Jul 11, 2018

Looks like the issue originates in vscode.TextDocument.uri.fsPath which normalizes drive letter to lowercase according to documentation: https://code.visualstudio.com/docs/extensionAPI/vscode-api

@edele
Copy link
Author

edele commented Jul 11, 2018

But the issue is not solved though. Does it impact anyone else?

Still thinking on a possible solution.

  1. Should we force uppercase drive letter because flow-bin uses uppercase?
  2. Should we change the way flow-bin decides if server_root and client_root are not the same just for Windows? (Windows paths are case-insensitive).

@ArmorDarks
Copy link

Same issue here.

@MannieJay
Copy link

Any workarounds?

@ArmorDarks
Copy link

I think there is none. Paths should be fixed in flow-for-vscode itself

@paczkow
Copy link

paczkow commented Sep 27, 2018

Same issue here on Windows 10, when I'm using Linux Ubuntu 18.04 is work correctly. Anyone did find solution?

@edele
Copy link
Author

edele commented Sep 27, 2018

We should do better path comparison in flow server for Windows as described here
facebook/flow#6592

Next little step would be to check if platform is win32 and lowercase path strings before comparing. It's ocaml tho 🐪

@Nauss
Copy link

Nauss commented Nov 5, 2018

I have the same issue.
A dirty workaround would be to use the npm script "flow": "flow stop && flow ."
It works but the server is restarted both when launched from the command line and by the vscode plugin.

@tomdbarker
Copy link

tomdbarker commented Aug 31, 2019

For me this was caused by a conflict with the flowtype v1.3.0 VSCode extension.
I gave up in the end and uninstalled the extension and flow worked as normal :/

@Mayank1791989
Copy link
Contributor

@tomdbarker What is the exact issue you are facing?

@tomdbarker
Copy link

"flow is running on a different directory"

@Mayank1791989
Copy link
Contributor

You are using wsl or normal shell?

@mroch
Copy link
Contributor

mroch commented Sep 3, 2019

thanks @Mayank1791989! i'll fix facebook/flow#6592 so it isn't a problem going forward but will still need your fix for previous versions.

@Mayank1791989
Copy link
Contributor

@mroch When fixed in flow we can put a version check to conditionally apply the fix.

@orta orta closed this as completed in cd0831b Sep 5, 2019
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

8 participants