jackwener/OpenCLI · error · ArgumentError

No board with id "${trimmed}"

Error message

No board with id "${trimmed}"

What it means

resolveBoardTarget resolves a board argument to {username, slug, path}. When the raw value is a numeric board id, it fetches the board via Pinterest's BoardResource (field_set_key=detailed). If the response contains no `url` for that board id, it throws this ArgumentError — Pinterest returned no board (deleted, private, or wrong id).

Source

Thrown at clis/pinterest/utils.js:303

  if (direct) return { ...direct, board: null };

  if (!/^\d+$/.test(trimmed)) {
    throw new ArgumentError(
      `Not a board reference: "${trimmed}"`,
      'Expected <username>/<slug>, a board URL, or a numeric board id (from `board-pins`/`user-boards`)',
    );
  }

  await page.goto(`${PINTEREST_BASE}/`);
  const { data: board } = await pinterestResourceFetch(
    page,
    'BoardResource',
    { board_id: trimmed, field_set_key: 'detailed' },
    '/',
  );
  const url = board && board.url;
  if (!url) {
    throw new ArgumentError(`No board with id "${trimmed}"`, 'Check the id with `opencli pinterest user-boards <username>`');
  }
  const parts = decodeSegment(url).split('/').filter(Boolean);
  if (parts.length < 2) {
    throw new CommandExecutionError(`Board ${trimmed} returned an unusable url: ${url}`);
  }
  // Hand the fetched board back so callers do not re-request what we already have.
  return { username: parts[0], slug: parts[1], path: `/${parts[0]}/${parts[1]}/`, board };
}

/**
 * Resolve a --section value against the board's real sections, accepting an id or a slug.
 * Pinterest ignores an unknown section silently, so an unmatched value must fail here.
 * Returns { sectionId, title, slug }.
 */
export async function resolveSection(page, boardId, sectionValue, sourceUrl) {
  const wanted = String(sectionValue ?? '').trim();
  const { results } = await pinterestResourceFetch(page, 'BoardSectionsResource', { board_id: String(boardId) }, sourceUrl);
  const sections = results.filter((section) => section && section.id);

View on GitHub (pinned to 49907e53dc)

Solutions

  1. List valid board ids with `opencli pinterest user-boards <username>` and use one of those ids.
  2. Pass the board as `<username>/<slug>` or a full pinterest.com board URL instead of a numeric id.
  3. Verify the board still exists and is accessible to the logged-in Pinterest session in a browser.
  4. Check for typos / whitespace in the id argument.

Example fix

// before
--board 5123456789012345
// after
--board someuser/recipe-ideas
Defensive patterns

Strategy: validation

Validate before calling

const boardArg = String(process.argv.board ?? '').trim();
if (/^\d+$/.test(boardArg) && !knownBoardIds.has(boardArg)) {
  throw new Error(`Board id ${boardArg} not in cached user-boards list — run 'opencli pinterest user-boards <username>' first`);
}

Try / catch

try {
  await runCmd(['opencli', 'pinterest', 'pin-create', '--board', boardId, ...]);
} catch (err) {
  if (String(err.message).includes('No board with id')) {
    // fall back to listing boards and re-resolving
    const boards = await listUserBoards(username);
    // pick fresh id and retry
  } else throw err;
}

Prevention

When it happens

Trigger: Calling any command with `--board <numeric-id>` where the id does not resolve: board was deleted, board belongs to another/secret account, id typo, or the BoardResource API returns an empty object for that board_id.

Common situations: Reusing a board id copied days ago from `board-pins`/`user-boards` output after the board was deleted or renamed-and-recreated; script hardcoding a board id from a different account; Pinterest returning sparse data for secret boards.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/c5ed89c431040860. Report an issue: GitHub.