Skip to content

Commit

Permalink
chore: better error message for unresolved import
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed May 8, 2024
1 parent d254e48 commit e9bead5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,12 @@ async function collectFromDependency(
): Promise<CollectResult> {
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;
Expand Down

0 comments on commit e9bead5

Please sign in to comment.