Skip to content

Commit

Permalink
Temporary Metro patch until RN upgrades Metro
Browse files Browse the repository at this point in the history
Issue message: "Error: EISDIR: illegal operation on a directory, read"
Fix PR on Metro: facebook/metro#567
  • Loading branch information
hypest committed Jun 17, 2021
1 parent e0d6503 commit 164d46c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gutenberg
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 13 additions & 0 deletions patches/metro+0.64.0.patch
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 164d46c

Please sign in to comment.