next.js icon indicating copy to clipboard operation
next.js copied to clipboard

fix: issue where fouc callback is paused in inactive tabs

Open peterjcaulfield opened this issue 4 months ago • 1 comments

The fouc helper callback queue gets paused in inactive tabs due to the usage of requestAnimationFrame (which gets paused at the browser level for resource optimization).

This means that new tabs opened via ctrl+click and Open Link in New Tab popup only commence loading once you visit them.

This only occurs for Turbpopack builds when using the Pages router.

All Webpack builds do not have this issue nor does App router when combined with Turbopack.

I created a clear repro repo for the issue here to aid reviewing: https://github.com/peterjcaulfield/turbopack-render-bug

peterjcaulfield avatar Dec 04 '25 09:12 peterjcaulfield

Allow CI Workflow Run

  • [ ] approve CI run for commit: 3ea2e28400043f5471cc82cecaf99f5c967aa98b

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

ijjk avatar Dec 04 '25 09:12 ijjk