getsentry / getsentry/sentry-javascript

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

Đang mở Phù hợp với người mới
#24,200 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
javascript
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
523

Mô tả

`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.
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
nextjs, typescript
Lĩnh vực
api, cli
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
75/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.