docs: Fix Solid, SolidStart, and NestJS README snippets - #24571
nicohrubec wants to merge 1 commit into
Conversation
Co-Authored-By: OpenAI Codex <codex@openai.com>
| }); | ||
|
|
||
| const SentryRouter = Sentry.withSentryRouterRouting(Router); | ||
| const SentryRouter = withSentryRouterRouting(Router); |
There was a problem hiding this comment.
Bug: The @sentry/solid README example incorrectly calls withSentryRouterRouting as a method on the Sentry namespace, which will cause a runtime TypeError.
Severity: HIGH
Suggested Fix
Update the README example to call withSentryRouterRouting(Router) directly, and ensure the import statement correctly imports it as a named export from '@sentry/solid/solidrouter'.
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: packages/solid/README.md#L42
Potential issue: The example code in the `@sentry/solid` README for setting up router
integration demonstrates an incorrect usage of `withSentryRouterRouting`. It shows
`Sentry.withSentryRouterRouting(Router)`, but `withSentryRouterRouting` is a named
export from the `@sentry/solid/solidrouter` module, not a property on the `Sentry`
namespace object. Users copying this code snippet will encounter a `TypeError:
Sentry.withSentryRouterRouting is not a function` at runtime, preventing the integration
from working.
Did we get this right? 👍 / 👎 to inform future reviews.
| ```typescript | ||
| import { Cron } from '@nestjs/schedule'; | ||
| import { SentryCron, MonitorConfig } from '@sentry/nestjs'; | ||
| import { SentryCron } from '@sentry/nestjs'; |
There was a problem hiding this comment.
Bug: The @sentry/nestjs README example incorrectly imports MonitorConfig from @sentry/nestjs, which will cause a TypeScript compilation error.
Severity: MEDIUM
Suggested Fix
Remove MonitorConfig from the import statement from '@sentry/nestjs'. The correct type import from '@sentry/core' is already included in the code snippet.
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: packages/nestjs/README.md#L136
Potential issue: The code example in the `@sentry/nestjs` README includes
`MonitorConfig` in the import statement from `@sentry/nestjs`. However, `MonitorConfig`
is not a public export of the `@sentry/nestjs` package. TypeScript users who copy this
code snippet will encounter a compilation error because the type cannot be found in the
specified module. The correct import for this type is from `@sentry/core`, which is
already present in the example on the following line.
Did we get this right? 👍 / 👎 to inform future reviews.
Fix the Solid and SolidStart README examples to call the imported router wrapper, and remove the duplicate NestJS
MonitorConfigimport so the snippets use valid imports.Closes #24548.