getsentry / getsentry/sentry-javascript

Update Sentry Example Page (auto-added in CLI) to work with cache components

未关闭 适合新手
#24,200 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
javascript
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
523

描述

`dymanic` is not allowed with cache components and currently our added example page throws this error:

```
./app/api/sentry-example-api/route.ts:2:14
Error: Route segment config "dynamic" is not compatible with `nextConfig.cacheComponents`. Please remove it.
1 | import * as Sentry from "@sentry/nextjs";
> 2 | export const dynamic = "force-dynamic";
| ^^^^^^^
3 |
4 | class SentryExampleAPIError extends Error {
5 | constructor(message: string | undefined) {

Ecmascript file had an error

at (./app/api/sentry-example-api/route.ts:2:14)
[ELIFECYCLE] Command failed with exit code 1.
```

贡献指南

打开贡献指南

调研方向

Start with the generated app/api/sentry-example-api/route.ts and reproduce the failure with nextConfig.cacheComponents enabled. Then find the CLI template that creates this example page and verify the generated route builds successfully without the reported route-segment configuration error.

由索引模型根据 Issue 内容生成。

评估

技术栈
nextjs, typescript
领域
api, cli
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
活跃
描述清晰度
描述清楚
新手友好度
75/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。