mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
7ec73949fc
The `instrumentation-client` Polyfills docs recommended a conditional dynamic `import().then()` to load a polyfill. That import is fire-and-forget: Next.js loads this file synchronously and does not await it before hydration, so the polyfill can install after components have already run (see #83905). - In "Execution timing" mention that only synchronous top-level code completes before hydration. Call out that a conditional `import()` here is not awaited, and cross-reference `supported-browsers` for load-on-demand strategies and the built-in baseline. - In **`supported-browsers.mdx`**, "fix" the `Conditionally loading polyfills` example to `await import()` instead of a floating `.then()`, otherwise, a reader needs to put their code within the `.then` chain of the polyfill load. Closes: https://linear.app/vercel/issue/DOC-6506/revisit-polyfills-with-instrumentation-client