Skip to content

Commit 735aa9f

Browse files
robhoganfacebook-github-bot
authored andcommitted
Don't attempt to use find crawler on Windows
Summary: This replicates the [hotfix](3703019) released in 0.73.7, to address an issue whereby Metro would fail to crawl files on Windows for non-Watchman MinGW users. A more substantial fix should follow - IMO, we should remove this `find` crawler completely unless it's more performant in some circumstance. This diff just brings in the quick, least-intrusive fix to get `main` up to parity with `0.73.x`. Closes: #914 Reviewed By: huntie Differential Revision: D42371016 fbshipit-source-id: 3bd9c5e5bd42245ada39b314ac2c6301ca4315f4
1 parent b942eca commit 735aa9f

File tree

1 file changed

+4
-1
lines changed
  • packages/metro-file-map/src/crawlers/node

1 file changed

+4
-1
lines changed

packages/metro-file-map/src/crawlers/node/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import H from '../../constants';
1717
import * as fastPath from '../../lib/fast_path';
1818
import {spawn} from 'child_process';
1919
import * as fs from 'graceful-fs';
20+
import {platform} from 'os';
2021
import * as path from 'path';
2122

2223
const debug = require('debug')('Metro:NodeCrawler');
@@ -177,7 +178,9 @@ module.exports = async function nodeCrawl(options: CrawlerOptions): Promise<{
177178
} = options;
178179
perfLogger?.point('nodeCrawl_start');
179180
const useNativeFind =
180-
!forceNodeFilesystemAPI && (await hasNativeFindSupport());
181+
!forceNodeFilesystemAPI &&
182+
platform() !== 'win32' &&
183+
(await hasNativeFindSupport());
181184

182185
debug('Using system find: %s', useNativeFind);
183186

0 commit comments

Comments
 (0)