Use feature flag in Next 16 Cache Component API GET route
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- next.js, typescript
調査の方向性
Start by reproducing the issue in the Next 16 API route GET method with Cache Components enabled, using the feature flag imported from lib/flags. Compare direct flag access with access from a cached data call; done when the route can read the flag without the headers() prerendering error.
索引モデルが issue の本文から書いたものです。
説明
I am trying to use a feature flag in a Next 16 app that has Cache Components enabled. I am trying to access the feature flag in an API routes GET method and receiving the error below. If I move the flag request into a cached data call, then it complains that headers() is accessed.
What is the correct way to handle this?
Error:
Error: During prerendering, `headers()` rejects when the prerender is complete. Typically these errors are handled by React but if you move `headers()` to a different context by using `setTimeout`, `after`, or similar functions you may observe this error and you should handle it in that context. . This occurred at route "/api/route-name"
Example Code:
import { flag } from 'lib/flags';
export async function GET(req: NextRequest): Promise<Response> {
const flagValue = await flag();
}
- 主要言語
- TypeScript
- スター
- 629
- フォーク
- 93
- 平均マージ
- 1日 15分
- マージ済み PR(30日)
- 25
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vercel/flags のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
[Feedback] Support/Docs for Next.js v16 "Cache Components"再び着手できるかも @dferber90 が 235 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンfeedback
vercel/flags#349 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Feedback] Interaction between precompute and `typedRoutes`再び着手できるかも @dferber90 が 263 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンfeedback
vercel/flags#287 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
vercel/flags#239 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AOSSIE-Org/DebateAI#801 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Add: BOM Cineオープンapproved check:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信