From e9bead51567254a8eae41f9d19307dd6832a7615 Mon Sep 17 00:00:00 2001 From: hasundue Date: Tue, 12 Mar 2024 13:34:53 +0900 Subject: [PATCH] chore: better error message for unresolved import --- core/update.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/update.ts b/core/update.ts index 55bdc162..8777b750 100644 --- a/core/update.ts +++ b/core/update.ts @@ -280,7 +280,12 @@ async function collectFromDependency( ): Promise { const resolved = dependencyJson.code?.specifier ?? dependencyJson.type?.specifier; - assertExists(resolved); + if (!resolved) { + throw new Error( + `Could not resolve the dependency: ${dependencyJson.specifier}`, + { cause: dependencyJson }, + ); + } const lock = options.lockFile ? await createLockPart(resolved, options.lockFile) : undefined;