Skip to content

fix(cli): Guard markdown rendering against undefined input - #1422

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/cli-2gs-undefined-slug
Open

fix(cli): Guard markdown rendering against undefined input#1422
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/cli-2gs-undefined-slug

Conversation

@sentry

@sentry sentry Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a TypeError: Cannot read properties of undefined (reading 'replace') that occurred when marked.lexer() received an undefined input.

The root cause was identified as p.slug being undefined for certain malformed project objects (e.g., from a self-hosted Sentry behind Cloudflare Access returning 302 redirects). This undefined value was then passed directly to renderInlineMarkdown and subsequently to marked.lexer(), which expects a string.

The fix involves two complementary changes:

  1. Defensive fix in markdown.ts: Added nullish coalescing (?? '') to marked.lexer() calls within renderInlineMarkdown (line 573) and renderMarkdown (lines 553 and 556). This ensures that the markdown lexer always receives a string, even if the input md is undefined or null.
  2. Data source fix in project/list.ts: Updated the PROJECT column definition in PROJECT_COLUMNS (line 236) to include a nullish guard: (p) => p.slug || ''. This prevents undefined p.slug values from ever reaching the markdown formatter, aligning its behavior with the ORG and PLATFORM columns which already use this pattern.

Fixes CLI-2GS

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview Aug 14, 2026 10:43am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants