flow icon indicating copy to clipboard operation
flow copied to clipboard

Server/client mismatch case sensitive URLs

Open steelsojka opened this issue 10 years ago • 19 comments

I'm getting this error when running [email protected] locally on MacOSX:

server_root: /Users/soj214/Projects/ngoms-ui-flow, client_root: /users/soj214/Projects/ngoms-ui-flow Unhandled exception: CommandExceptions.Server_directory_mismatch

I assume this has to do with macs case insensitive file system. Is there a current solution/configuration for this?

steelsojka avatar Jul 22 '16 17:07 steelsojka

cc @gabelevi

avikchaudhuri avatar Jul 22 '16 18:07 avikchaudhuri

I'm getting this on windows:

flow is running on a different directory.
server_root: e:\1stuff\dev\javascript\tags\webapp, client_root: E:\1stuff\dev\javascript\tags\webapp
Unhandled exception: CommandExceptions.Server_directory_mismatch

ubershmekel avatar Nov 30 '16 07:11 ubershmekel

+1 on my mac. server_root: /Users/xiangyong/WebstormProjects/test, client_root: /Users/xiangyong/webstormprojects/test

YongX avatar Dec 01 '16 06:12 YongX

+1, facing this error on windows, any news?

lednhatkhanh avatar Jan 10 '17 10:01 lednhatkhanh

I saw this issue in Git Bash on Windows. However, it works when I switched to Windows PowerShell.

peterjoel avatar Feb 14 '17 19:02 peterjoel

Have identical paths except of drive letters on Windows
server_root: D:\www\my\***, client_root: d:\www\my\***
Edit: looks like using Power Shell solved the problem

burdiuz avatar Mar 29 '17 08:03 burdiuz

Not sure it related. First run crashes with

 13: AdSettings.addTestDevice(AdSettings.deviceHashedId);
                                         ^^^^^^^^^^^^^^ property `deviceHashedId`. Property not found in
 13: AdSettings.addTestDevice(AdSettings.deviceHashedId);
                              ^^^^^^^^^^ object literal

node_modules/react-native-fbads/src/BannerViewManager.js:40
 40:   const { type, onPress, onError, style, ...restProps } = props;
                                       ^^^^^ property `style`. Property not found in
 40:   const { type, onPress, onError, style, ...restProps } = props;
                                                               ^^^^^ object type


Found 2 errors

Second run: flow is running on a different directory. server_root: d:\Projects\testCRNA, client_root: D:\Projects\testCRNA Unhandled exception: CommandExceptions.Server_directory_mismatch

Using Powershell and cmd under windows.

Trenrod avatar Apr 01 '17 11:04 Trenrod

Same problem. No matter what I'm using I get a mismatch. Tried with cmd, powershell, git-bash. The only part of path that doesn't match is drive letter. "c", "C".

Unhandled exception: CommandExceptions.Server_directory_mismatch

Does anyone have a workaround?

michaluu avatar Apr 11 '17 09:04 michaluu

@michaluu I had the same problem and fixed it by adding a script to call flow with the lowercased path:

// file: scripts/flow.js
const child_process = require('child_process');
const dir = process.cwd();
const client_root = dir.charAt(0).toLowerCase() + dir.slice(1);
child_process.execSync(`flow status ${client_root}`, { stdio: [0, 1, 2] });
// package.json
{
  "scripts": {
    "flow": "node ./scripts/flow"
  }
}

jschfflr avatar May 13 '17 18:05 jschfflr

Failed for me on first run (in Powershell), then on second run it worked.

willemodendaal avatar Jul 04 '17 05:07 willemodendaal

Same problem - suddenly

flow is running on a different directory. server_root: d:\Projects\wf2\xxx, client_root: D:\Projects\wf2\xxx

wgilpin avatar Aug 10 '17 20:08 wgilpin

If you are using visual code. Adding ( "flow.useNPMPackagedFlow": false ) to ( User Settings ) can solve the problem.

Mg-Yaya avatar Oct 02 '17 02:10 Mg-Yaya

@Mg-Yaya This setting doesn't exist, so error message Unknown configuration setting is shown

bondom avatar Feb 09 '18 07:02 bondom

For those of you who has this issue in vscode and uses this plugin in your project: https://github.com/zhirzh/flow-babel-webpack-plugin

You can use updated version of this plugin that fixes this error: https://github.com/bondom/flow-babel-webpack-plugin

I applied fix proposed by @ghodir above

bondom avatar Feb 09 '18 10:02 bondom

@michaluu I had the same problem and fixed it by adding a script to call flow with the lowercased path:

// file: scripts/flow.js
const child_process = require('child_process');
const dir = process.cwd();
const client_root = dir.charAt(0).toLowerCase() + dir.slice(1);
child_process.execSync(`flow status ${client_root}`, { stdio: [0, 1, 2] });
// package.json
{
  "scripts": {
    "flow": "node ./scripts/flow"
  }
}

I modified your workaround a little bit, so that you could execute other flow commands as well f.e. flow stop:

const childProcess = require('child_process');

const executeFlow = options => {
  childProcess.execSync(`flow ${options.join(' ')}`, { stdio: [0, 1, 2] });
};

const flowCommands = process.argv.slice(2);

if (flowCommands.length > 0) {
  return executeFlow(flowCommands);
}

const dir = process.cwd();
const clientRoot = dir.charAt(0).toLowerCase() + dir.slice(1);
return executeFlow(['status', clientRoot, '--color=always']);

bmsuseluda avatar Oct 05 '18 07:10 bmsuseluda

2020 and here I have the same issue...

moongoal avatar Jul 16 '20 22:07 moongoal

@moongoal what about now with #6592 fixed?

nifgraup avatar Dec 10 '20 14:12 nifgraup

@nifgraup that project was moved to a different technology, I won't be able to help on this I'm afraid.

moongoal avatar Dec 22 '20 23:12 moongoal

this should be fixed by https://github.com/facebook/flow/commit/859a35cb5f07a3fc4256e9a293163147b9cf8129 which removed the check.

on case-insensitive filesystems the differently-cased roots refer to the same directory, so they will connect to the same socket, which should be as desired.

mroch avatar Aug 18 '22 19:08 mroch