Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/no-team-recovery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vercel/board': patch
---

When `vercel board` can't tell which team's board to use, like outside a linked project in a non-interactive run, its error now says how to go on: the same command with `--scope <TEAM>`, or with `--url <URL>` (or `BOARD_URL`).
11 changes: 10 additions & 1 deletion packages/board/src/cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,16 @@ function failureOf(error: unknown): Failure {
case 'too_large':
return { ...own('limit', 'payload_too_large'), message: `Can't ${doing()}. ${sentence(message)}` }
case 'no_team':
return { ...own('platform', 'api_error'), message: "Couldn't tell which team's board to use.", details: [message] }
// Outside a linked project, the app may know no team to use: the same command with one, or a board's URL, still works.
return {
...own('platform', 'api_error', [
...fix,
{ instruction: "Use a team's board", argv: rerun('--scope', '<TEAM>') },
{ instruction: 'Or a board at a URL (or set BOARD_URL)', argv: rerun('--url', '<URL>') },
]),
message: "Couldn't tell which team's board to use.",
details: [message],
}
case 'upload_failed':
return { ...own('platform', 'upload_failed'), message: `Failed to ${doing()}.`, details: [message] }
case 'channel_exists':
Expand Down
4 changes: 4 additions & 0 deletions packages/board/test/cli-embedded.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ describe('the embedded CLI', () => {
reason: 'api_error',
message: "Couldn't tell which team's board to use.",
details: ['request to https://api.vercel.com/v2/user failed, reason: getaddrinfo ENOTFOUND'],
next: [
{ instruction: "Use a team's board", argv: ['vercel', 'board', 'read', 'general', '--scope', '<TEAM>'] },
{ instruction: 'Or a board at a URL (or set BOARD_URL)', argv: ['vercel', 'board', 'read', 'general', '--url', '<URL>'] },
],
},
])
expect([fetching.mock.calls, logged.mock.calls]).toEqual([[], []])
Expand Down