mirror of https://github.com/status-im/metro.git
Packager - Fix symbolicate on windows
Summary: There was an error with packager symbolization on Windows because it looks like `allowHalfOpen: true` doesn't work properly when using named sockets. This uses a random port on localhost for the connection instead on Windows as a workaround. **Test plan** Tested that symbolization works on both mac and windows by triggering a warning in UIExplorer. Closes https://github.com/facebook/react-native/pull/13828 Differential Revision: D5019537 Pulled By: davidaurelio fbshipit-source-id: 62c5b5f270e553a7d413bb4d1bab2406380f1d4f
This commit is contained in:
parent
5905385997
commit
fb2f256dc3
|
@ -30,7 +30,11 @@ const affixes = {prefix: 'metro-bundler-symbolicate', suffix: '.sock'};
|
|||
const childPath = require.resolve('./worker');
|
||||
|
||||
exports.createWorker = (): Symbolicate => {
|
||||
const socket = xpipe.eq(temp.path(affixes));
|
||||
// There are issues with named sockets on windows that cause the connection to
|
||||
// close too early so run the symbolicate server on a random localhost port.
|
||||
const socket = process.platform === 'win32'
|
||||
? 34712
|
||||
: xpipe.eq(temp.path(affixes));
|
||||
const child = new LockingPromise(new LazyPromise(() => startupChild(socket)));
|
||||
|
||||
return (stack, sourceMaps) =>
|
||||
|
@ -53,6 +57,7 @@ function startupChild(socket) {
|
|||
child.removeAllListeners();
|
||||
resolve(child);
|
||||
});
|
||||
// $FlowFixMe ChildProcess.send should accept any type.
|
||||
child.send(socket);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue