feat(onboarding): Update Hono onboarding with @sentry/hono#115476
feat(onboarding): Update Hono onboarding with @sentry/hono#115476s1gr1d wants to merge 3 commits into
@sentry/hono#115476Conversation
| export const logs = getNodeLogsOnboarding({ | ||
| docsPlatform: 'hono', | ||
| packageName: '@sentry/node', | ||
| packageName: '@sentry/hono', |
There was a problem hiding this comment.
Bug: The Hono onboarding configuration for logs, metrics, and MCP uses a static placeholder importPath of '@sentry/hono/<your-runtime>', resulting in invalid import statements in generated code snippets.
Severity: HIGH
Suggested Fix
Update the code generation logic to dynamically substitute the <your-runtime> placeholder within the importPath string with the actual runtime value selected by the user during the onboarding flow.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/gettingStartedDocs/node-hono/logs.tsx#L5
Potential issue: The onboarding configurations for Hono logs, metrics, and performance
monitoring use a static placeholder string `'@sentry/hono/<your-runtime>'` for the
`importPath`. This placeholder is directly embedded into the generated code snippets
shown to the user without being substituted with the actual selected runtime (e.g.,
`node`, `cloudflare`). This results in an invalid import statement like `import * as
Sentry from "@sentry/hono/<your-runtime>";`, which will cause the user's application to
fail.
Also affects:
static/app/gettingStartedDocs/node-hono/mcp.tsx:4~4static/app/gettingStartedDocs/node-hono/metrics.tsx:5~5
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
This is on purpose, there is no neat way to do this currently without refactoring this. It's better to include < your runtime > than have a wrong @sentry/hono/node import (when using e.g. Cloudflare) as it's harder to catch the problem.
📊 Type Coverage Diff
🔍 2 new type safety issues introducedType assertions (
This is informational only and does not block the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d84b555. Configure here.
| export const mcp = getNodeMcpOnboarding({ | ||
| packageName: '@sentry/hono', | ||
| importPath: '@sentry/hono/<your-runtime>', | ||
| }); |
There was a problem hiding this comment.
Bug: Hono onboarding for logs, mcp, and metrics generates code snippets with an invalid, placeholder import path @sentry/hono/<your-runtime>, which will cause an error for users.
Severity: HIGH
Suggested Fix
The onboarding configuration objects for logs, mcp, and metrics should be generated dynamically at render time, rather than being static constants. This would allow them to access the params object, which contains the user-selected platformOptions.runtime, and construct a valid, runtime-specific import path. This would align their behavior with the main onboarding.tsx file.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/gettingStartedDocs/node-hono/mcp.tsx#L3-L6
Potential issue: The Hono onboarding configurations for `logs`, `mcp`, and `metrics` are
created at module load time with a static, placeholder `importPath` value of
`'@sentry/hono/<your-runtime>'`. The utility functions that consume this path, such as
`getNodeMcpOnboarding`, use it verbatim to generate code snippets for the user. This
results in an invalid import statement, `import * as Sentry from
"@sentry/hono/<your-runtime>";`, being displayed in the setup documentation. Because the
configuration is static, there is no opportunity to substitute the `<your-runtime>`
placeholder with the actual runtime selected by the user, leading to code that will fail
with a module not found error when copied.
Also affects:
static/app/gettingStartedDocs/node-hono/metrics.tsx:3~6

Updates the Hono onboarding guide to use the new dedicated @sentry/hono SDK which supports multiple runtimes (Cloudflare Workers, Node.js, and Bun).
platformOptions) so users can switch between Cloudflare Workers, Node.js, and Bun instructionsimportPathoption to shared onboarding utilities (logs, metrics, mcp) so Hono can use a different path for import statements (@sentry/hono/node) than for install commands (@sentry/hono)closes getsentry/sentry-javascript#20817