Skip to content
PR Quorum
Sign inStart free
← Review gallery
vercel/next.js #95920openreviewed 6h ago

fix: wire experimental.webVitalsAttribution into useReportWebVitals

by dayongkr+114 176 filesreviewed in 38sView PR on GitHub
needs attentionThe panel surfaced issues that deserve attention before merge.1 finding · 1 high+

Reviewer panel

Correctness
deepseek/deepseek-v4-flash
0 found
Security
deepseek/deepseek-v4-flash
0 found
Architecture
deepseek/deepseek-v4-flash
1 found

Findings

01Hhighconf 95%

process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION is always a string, not a boolean

packages/next/src/client/web-vitals.ts:22

The condition if (process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION) checks a string environment variable for truthiness. In Next.js, compile-time env vars like __NEXT_HAS_WEB_VITALS_ATTRIBUTION are replaced with the string 'true' or 'false' (or are undefined). The string 'false' is truthy in JavaScript, so this condition will always be true when the env var is defined, even when attribution is disabled. This means the attribution bundle will always be loaded and checked against the attributions list, even when experimental.webVitalsAttribution is not configured. This is a bug that causes unnecessary bundle loading and potential runtime overhead.

Suggested fix

if (attributions?.length) {

Want this on your own pull requests?
The same reviewer panel runs on every PR — one focused review, no noise.
Start freeLive demo