Skip to content

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

Merged
BYK merged 2 commits into
mainfrom
seer/fix/cli-2gs-undefined-slug
Aug 19, 2026
Merged

fix(cli): Guard markdown rendering against undefined input#1422
BYK merged 2 commits 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 19, 2026 7:11am

Request Review

@BYK
BYK enabled auto-merge (squash) August 19, 2026 07:11
@BYK
BYK merged commit f84fa8a into main Aug 19, 2026
31 checks passed
@BYK
BYK deleted the seer/fix/cli-2gs-undefined-slug branch August 19, 2026 07:19
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.

1 participant