From 164d46cdc337775fc79e3311804a6561512abe17 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Thu, 17 Jun 2021 18:21:26 +0300 Subject: [PATCH] Temporary Metro patch until RN upgrades Metro Issue message: "Error: EISDIR: illegal operation on a directory, read" Fix PR on Metro: https://github.com/facebook/metro/pull/567 --- gutenberg | 2 +- package.json | 2 +- patches/metro+0.64.0.patch | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 patches/metro+0.64.0.patch diff --git a/gutenberg b/gutenberg index 764f2e5be3..170e4dcefa 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit 764f2e5be3ffd811df61d3e9c510243b85e64156 +Subproject commit 170e4dcefa880f2acaf62a936a862a7926d4c65f diff --git a/package.json b/package.json index 81c27eb7e4..b6ace2355f 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "yarn": "^1.22.10" }, "scripts": { - "postinstall": "npm ci --prefix gutenberg && cd jetpack/projects/plugins/jetpack && npx pnpm install", + "postinstall": "patch-package && npm ci --prefix gutenberg && cd jetpack/projects/plugins/jetpack && npx pnpm install", "start": "echo \"\\x1b[33mThe start command is not available in this project. It is strongly recommended to use \\x1b[1:33mstart:reset\\x1b[0m\\x1b[33m to perform some cleanup when starting the metro bundler.\nOr you may use \\x1b[1:33mstart:quick\\x1b[0m\\x1b[33m for a quicker startup, but this may lead to unexpected javascript errors when running the app.\\x1b[0m\"", "start:reset": "npm run core clean:runtime && npm run start:quick -- --reset-cache", "start:quick": "react-native start --config ./metro.config.js", diff --git a/patches/metro+0.64.0.patch b/patches/metro+0.64.0.patch new file mode 100644 index 0000000000..249ae5cecd --- /dev/null +++ b/patches/metro+0.64.0.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js b/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js +index 5f32fc5..2b80fda 100644 +--- a/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js ++++ b/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js +@@ -346,7 +346,7 @@ class UnableToResolveError extends Error { + try { + file = fs.readFileSync(this.originModulePath, "utf8"); + } catch (error) { +- if (error.code === "ENOENT") { ++ if (error.code === "ENOENT" || error.code === 'EISDIR') { + // We're probably dealing with a virtualised file system where + // `this.originModulePath` doesn't actually exist on disk. + // We can't show a code frame, but there's no need to let this I/O