Hydration hint of a component with no name is rejected (400 Invalid payload) and surfaces as an unhandled error
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nuxt, typescript
調査の方向性
src/runtime/hydration/composables.tsのhydrationレポート呼び出し箇所と、src/runtime/hydration/handlers.tsのassertPayloadから始めてください。名前のないコンポーネントがどのようにpayloadに渡されるか、拒否されたレポートがどのように処理されるかを追ってください。提示されたtemplateのみの再現例に対してヒントを保存でき、レポートの失敗が未処理エラーにならなければ完了です。issueには実行するテストファイルの指定がありません。
索引モデルが issue の本文から書いたものです。
説明
Environment
- nuxt 4.6.2 (SSR, dev mode)
- @nuxt/hints 1.1.5 (also checked against
main: same code) - vue 3.5.44
- Node.js 26.13.0, Windows 11
Reproduction
A page with no <script setup> (template only), whose HTML differs between server and client, pages/repro.vue:
<template>
<div>{{ Date.now() }}</div>
</template>
Open /repro in dev mode.
Describe the bug
The hydration hint for that page is never stored, and an unhandled error opens Nuxt's dev error overlay:
FetchError: [POST] "/__nuxt_hints/hydration": 400 Invalid payload
Why it happens (src/runtime/hydration/composables.ts):
componentName = instance.type.name ?? instance.type.displayName ?? instance.type.__name. A component with none of the three (a template-only SFC, which gets no__name) sendscomponentName: undefined. I logged the rejected body:componentNameisundefined,fileLocationis the page path, both HTML fields are strings.- The server handler rejects it:
assertPayloadrequirestypeof body.componentName === 'string'(src/runtime/hydration/handlers.ts). - The
$fetch(HYDRATION_ROUTE, …).then(…)call has no.catch, so the rejection becomes an unhandled error.
Side effect: the dev error overlay (nuxt-error-overlay) contains a <main>, so accessibility checks run on the page (axe landmark-no-duplicate-main) report two main landmarks.
Expected: the hint is stored and shown in the DevTools panel like the others, and a failed report does not surface as an unhandled error.
Suggestion:
- fall back to a name derived from
__file(e.g. the file's base name) or a placeholder like'Anonymous'whenname,displayNameand__nameare all missing; - and/or add a
.catchto the report call that logs a warning instead of throwing.
Additional context
Found while triaging the hydration hints of an app together with #409 (a different false positive in the same check).
Logs
FetchError: [POST] "/__nuxt_hints/hydration": 400 Invalid payload
at async $fetch2 (.../ofetch/dist/shared/ofetch.CWycOUEr.mjs:332:15)
- 主要言語
- TypeScript
- スター
- 347
- フォーク
- 15
- 平均マージ
- 7分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nuxt/hints のほかの issue
-
Hydration hint false positive: `class=""` appears on dynamic components with an undefined class対応中かも @lafllamme が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
need reproduction
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
nuxt/hints#277 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Make hydration diff more precise再び着手できるかも @huang-julien が 259 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
nuxt/hints#257 · コメント 1 件 · リアクション 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Assets Hints for improved performance再び着手できるかも @Baroshem が 296 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
nuxt/hints#199 · コメント 3 件 · リアクション 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Search input loses focus while typing on the Inventory, Reservations and Locations lists (view_configurations enabled)対応中かも @medusa-os-bot が今日担当しました。 オープンstatus: needs triaging type: bug version: 2.0
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
medusajs/medusa#17886 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
marimo-team/marimo#11949 ·
メンテナーはふだん 1 日以内に返信
-
bug server-time v2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/servers#5559 ·
メンテナーはふだん 1 日以内に返信
-
D1 Time Travel restore help advertises 30 days without a plan qualifier対応中かも @akhil9tiet が今日担当しました。 オープンbug package:wrangler product:d1
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
cloudflare/workers-sdk#17000 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信