Flow: Server/client mismatch case sensitive URLs

Created on 22 Jul 2016  路  18Comments  路  Source: facebook/flow

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?

Crash

Most helpful comment

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

All 18 comments

cc @gabelevi

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

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

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

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

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

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.

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 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"
  }
}

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

Same problem - suddenly

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

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

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

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

@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']);

2020 and here I have the same issue...

@moongoal what about now with #6592 fixed?

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

Was this page helpful?
0 / 5 - 0 ratings