From d7a9ed9714c2a2c3a8c05ef020d495f5be03972a Mon Sep 17 00:00:00 2001 From: Vedant Pandey Date: Mon, 24 Jul 2023 14:00:03 +0530 Subject: [PATCH] fix(node_compat): Wrap require resolve exports in try catch block (#19592) Potentially closes #19499 --- ext/node/polyfills/01_require.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 696c1ef5c9..a21754ca7a 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -507,6 +507,10 @@ function resolveExports( return; } + if (!parentPath) { + return false; + } + return ops.op_require_resolve_exports( usesLocalNodeModulesDir, modulesPath,