Skip to content

fix(js): Replace hardcoded @sentry/browser imports with ___SDK_PACKAGE___ placeholder#16371

Open
sergical wants to merge 2 commits intomasterfrom
fix/sdk-package-placeholder
Open

fix(js): Replace hardcoded @sentry/browser imports with ___SDK_PACKAGE___ placeholder#16371
sergical wants to merge 2 commits intomasterfrom
fix/sdk-package-placeholder

Conversation

@sergical
Copy link
Member

DESCRIBE YOUR PR

Code snippets across 26 platform-includes/**/javascript.mdx files used hardcoded import * as Sentry from "@sentry/browser" instead of the ___SDK_PACKAGE___ placeholder. This caused guide pages (e.g. /platforms/javascript/guides/nextjs/metrics/) to show @sentry/browser instead of the correct package (@sentry/nextjs, @sentry/react, etc.).

The ___SDK_PACKAGE___ placeholder is already supported by codeKeywords.tsx and gets replaced at render time with the correct package for each platform/guide.

  • Replaced @sentry/browser with ___SDK_PACKAGE___ in import statements inside code blocks across 26 files
  • Removed now-unnecessary "substitute/replace @sentry/browser" comments (5 files)
  • Fixed highlight line number in session-replay/setup-canvas/javascript.mdx after comment removal
  • Intentionally skipped: migration docs, LLM rules, _default files, and install command snippets

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

🤖 Generated with Claude Code

…E___ placeholder

Code snippets in platform-includes used hardcoded `@sentry/browser` imports,
which showed the wrong package name on guide pages (e.g. Next.js guide showed
`@sentry/browser` instead of `@sentry/nextjs`). The ___SDK_PACKAGE___ placeholder
is already supported by the codeKeywords system and gets replaced at render time
with the correct package for each platform/guide.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 12, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Feb 12, 2026 8:46pm
sentry-docs Ready Ready Preview, Comment Feb 12, 2026 8:46pm

Request Review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant