From 7505f0c055213608c4084d4ff20e3a4ff707c4f0 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 --- lib/update.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/update.ts b/lib/update.ts index ab396d16..d1c5ec3f 100644 --- a/lib/update.ts +++ b/lib/update.ts @@ -251,7 +251,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;