AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Experimental.WebVitalsAttribution Has No Effect On UseReportWebVitals

The experimental.webVitalsAttribution config option is accepted but the attribution data is never attached to metrics reported by useReportWebVitals because the code that consumed __NEXT_WEB_VITALS_ATTRIBUTION was removed. The hook currently imports only the non-attribution web-vitals build.

highConfidence 85%Next.jsServer ActionsHydrationAffected V14.2.xAffected V15.0.0Affected V16.3.0-Canary.89

Origin Analysis

The `experimental.webVitalsAttribution` option is injected as `__NEXT_WEB_VITALS_ATTRIBUTION` but nothing reads it after the performance relayer was removed in #64199. `useReportWebVitals` still imports the standard `next/dist/compiled/web-vitals` functions, which do not provide attribution; it never imports or uses the attribution build.
1. Clone https://github.com/dayongkr/webvitals-attribution-repro, then run `npm install && npm run dev` 2. Open http://localhost:3000 with the browser console open 3. Click anywhere on the page (flushes LCP/INP), then switch tabs once (flushes CLS) 4. Compare the `[useReportWebVitals]` logs with the `[web-vitals/attribution]` logs

Fixing Code Block

Edge Case Audit

Enabling the attribution build increases bundle size; static import of both modules may cause attribution module to be included for all users if tree-shaking fails. Additionally, this implementation enables attribution for all metrics when any are configured, not just the whitelisted ones. Rollback by reverting to `import * as webVitals from 'next/dist/compiled/web-vitals'` and removing the attribution import. Verify `process.env.__NEXT_WEB_VITALS_ATTRIBUTION` remains a valid JSON array; malformed JSON is caught but would silently disable attribution.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state