Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the error message when a package referenced in a changeset can't be found #767

Merged
merged 1 commit into from Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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