From a9b85ba6f6db090c412fe4f3a6f5aa4c8688a9b3 Mon Sep 17 00:00:00 2001 From: Vladimir Grenaderov Date: Mon, 23 Oct 2023 16:13:42 +0000 Subject: [PATCH 1/2] catch exceptions generated by pnpapi --- src/pnpResolver.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pnpResolver.js b/src/pnpResolver.js index 26edf29..c8c966f 100644 --- a/src/pnpResolver.js +++ b/src/pnpResolver.js @@ -12,7 +12,10 @@ export default pnpapi && ((id, parent) => { return null } - const path = pnpapi.resolveRequest(id, parent) + let path = null + try { + path = pnpapi.resolveRequest(id, parent) + } catch {} return path !== null ? pathToFileURL(path).href : null }) From f1135fb31bc448b3e4307f277bafebad37344737 Mon Sep 17 00:00:00 2001 From: Vladimir Grenaderov Date: Mon, 23 Oct 2023 16:21:40 +0000 Subject: [PATCH 2/2] fix linter --- src/pnpResolver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pnpResolver.js b/src/pnpResolver.js index c8c966f..0d92395 100644 --- a/src/pnpResolver.js +++ b/src/pnpResolver.js @@ -15,7 +15,7 @@ export default pnpapi && ((id, parent) => { let path = null try { path = pnpapi.resolveRequest(id, parent) - } catch {} + } catch { /* empty */ } return path !== null ? pathToFileURL(path).href : null })