BloopAI/vibe-kanban · error · Error

Missing required fields

Error message

Missing required fields

What it means

CreateWorkspaceFromPrDialog validates that a repo, PR number, remote, and PR record were all selected before calling workspacesApi.createFromPr. If any is missing it throws 'Missing required fields'. The SOURCE block contains the throw site (validation guard); RAISED IN points at the dialog component itself.

Source

Thrown at packages/web-core/src/shared/dialogs/command-bar/CreateWorkspaceFromPrDialog.tsx:140

          break;
        default:
          prsErrorMessage =
            prsResult.message ||
            t('createWorkspaceFromPr.errors.failedToLoadPrs');
      }
    } else if (prsError) {
      prsErrorMessage = t('createWorkspaceFromPr.errors.failedToLoadPrs');
    }

    const createMutation = useMutation({
      mutationFn: async () => {
        if (
          !selectedRepoId ||
          !selectedPrNumber ||
          !selectedRemote ||
          !selectedPr
        ) {
          throw new Error('Missing required fields');
        }
        const result = await workspacesApi.createFromPr({
          repo_id: selectedRepoId,
          pr_number: selectedPrNumber as unknown as bigint,
          pr_title: selectedPr.title,
          pr_url: selectedPr.url,
          head_branch: selectedPr.head_branch,
          base_branch: selectedPr.base_branch,
          run_setup: runSetup,
          remote_name: selectedRemote,
        });
        if (!result.success) {
          switch (result.error?.type) {
            case 'branch_fetch_failed':
              throw new Error(result.error.message);
            case 'auth_failed':
              throw new Error(result.error.message);
            case 'cli_not_installed':

View on GitHub (pinned to 4deb7eca8f)

Solutions

  1. Disable the submit button until all four fields (selectedRepoId, selectedPrNumber, selectedRemote, selectedPr) are non-null
  2. Verify the PR/repo fetches completed and set state before allowing submission
  3. Check that the chosen repo actually has matching remotes; surface a message when none exist
  4. If it persists, confirm the API responses actually populate the selection state (network tab)

Example fix

// before
disabled={creating}
// after
disabled={creating || !selectedRepoId || !selectedPrNumber || !selectedRemote || !selectedPr}
Defensive patterns

Strategy: validation

Validate before calling

const canSubmit = !!selectedRepoId && !!selectedPrNumber && !!selectedRemote && !!selectedPr;
if (!canSubmit) return; // or disable the button with !canSubmit

Type guard

function isSelectionComplete(s: { repoId?: string|null; prNumber?: number|null; remote?: string|null; pr?: { title: string }|null }): s is { repoId: string; prNumber: number; remote: string; pr: { title: string } } { return !!s.repoId && !!s.prNumber && !!s.remote && !!s.pr; }

Try / catch

try {
  await createWorkspaceFromPr(fields);
} catch (e) {
  if (e.message === 'Missing required fields') notify.warn('Please wait for the PR and repo to finish loading.');
}

Prevention

When it happens

Trigger: Submitting the dialog while state is incomplete: async PR/repo loading hasn't finished, remote list empty so selectedRemote stays null, or the user bypasses the disabled button via keyboard/Enter before selections resolve.

Common situations: Slow GitHub/GitLab API causing selectedPr to remain null while the button is clickable; a repo with no remotes so selectedRemote is never set; race between fetch resolution and form submit.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29). Data as JSON: /api/errors/cc9ff518a88fae0a. Report an issue: GitHub.