diff options
author | Vedant Pandey <vedantpandey46@gmail.com> | 2023-07-24 14:00:03 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-24 11:30:03 +0300 |
commit | d7a9ed9714c2a2c3a8c05ef020d495f5be03972a (patch) | |
tree | e06aa83dc741682704a6759e4bd4f4bc6dec5faf | |
parent | 9b4a588d41ce58b05270cb163e3cd4f0de7f8fb4 (diff) |
fix(node_compat): Wrap require resolve exports in try catch block (#19592)
Potentially closes #19499
-rw-r--r-- | ext/node/polyfills/01_require.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 696c1ef5c..a21754ca7 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, |