Skip to content

Commit

Permalink
Improve the error message when a package referenced in a changeset ca…
Browse files Browse the repository at this point in the history
…n't be found (#767)
  • Loading branch information
Andarist committed Jun 1, 2022
1 parent a22eb8c commit d6bfcc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/ninety-moose-give.md
@@ -0,0 +1,6 @@
---
"@changesets/assemble-release-plan": patch
"@changesets/cli": patch
---

Improve the error message when a package referenced in a changeset can't be found. The message will now also include the changeset's ID.
4 changes: 3 additions & 1 deletion packages/assemble-release-plan/src/flatten-releases.ts
Expand Up @@ -21,7 +21,9 @@ export default function flattenReleases(
let release = releases.get(name);
let pkg = packagesByName.get(name);
if (!pkg) {
throw new Error(`Could not find package information for ${name}`);
throw new Error(
`"${changeset.id}" changeset mentions a release for a package "${name}" but such a package could not be found.`
);
}
if (!release) {
release = {
Expand Down

0 comments on commit d6bfcc5

Please sign in to comment.