-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Description
Link to the code that reproduces this issue
https://github.com/samtbg/userReportWebVitalsMissingLCP
To Reproduce
- Clone the linked repository and run the necessary package install command:
npm install --legacy-peer-deps
- Start the development server:
npm run dev
-
Navigate to http://localhost:3000.
-
Open the browser DevTools Console and clear the logs.
Test 1 (Failure Scenario - Idle User)
This demonstrates the missing LCP report:
Reload the page.
Wait 12 seconds without moving or clicking the mouse.
Result: The console will show the "10-second timer fired" message. The OTel flush runs, and the log will confirm TTFB and FCP were sent, but LCP is missing.
Test 2 (Success Scenario - Interactive User)
This demonstrates the required workaround:
Reload the page.
Wait 5 seconds (the LCP element is visible).
Click once anywhere on the white space. The console should show the LCP metric recorded immediately after the click.
Wait for the 10-second timer to fire (5 more seconds).
Result: The console will successfully show TTFB, FCP, and LCP being sent.
Current vs. Expected behavior
Current Behavior (Observable in the Console):
Test 1 (Failure): The console immediately logs the recording of TTFB and FCP. At approximately 10 seconds, the console logs the "10-second timer fired" and the OTel flush runs. The final flush log shows that LCP is missing from the buffer. The useReportWebVitals callback for LCP never executes.
Test 2 (Success): When a click on the page occurs, LCP is recorded and reported in the console
Expected Behaviour
The LCP is recorded/reported irregardless of user interaction
Provide environment information
From the reproduction:
Operating System:
Platform: linux
Arch: x64
Version: #88-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 09:28:41 UTC 2025
Available memory (MB): 39737
Available CPU cores: 8
Binaries:
Node: 20.11.0
npm: 11.4.2
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 16.0.2-canary.24 // Latest available version is detected (16.0.2-canary.24).
eslint-config-next: N/A
react: 18.3.1
react-dom: 18.3.1
typescript: 5.4.5
Next.js Config:
output: N/A
However we're seeing this behaviour in our NextJS apps (which have a wide range of versions)Which area(s) are affected? (Select all that apply)
Performance
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response