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

未關閉 適合新手
#24,200 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
75/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
nextjs, typescript
領域
api, cli

研究方向

從產生的 app/api/sentry-example-api/route.ts 開始,並在啟用 nextConfig.cacheComponents 的情況下重現失敗。接著找到建立此範例頁面的 CLI 範本,並驗證產生的 route 能夠成功建置,而不會出現回報的 route-segment 設定錯誤。

由索引模型根據 Issue 內容生成。

描述

javascript

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 <unknown> (./app/api/sentry-example-api/route.ts:2:14)
[ELIFECYCLE] Command failed with exit code 1.
主要語言
TypeScript
星號
8.7k
分支
1.9k
平均合併
1 天 17 小時
30 天內合併 PR
521

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

getsentry/sentry-javascript 的其他 Issue

查看 getsentry/sentry-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。