polyfill-nomodule.js flagged in new experimental-analyze tool despite modern-only browserslist — related to #86785? #96886
Replies: 2 comments
|
There isn't a supported build-time opt-out for this today. The So your reading is right: a modern-only browserslist will not remove |
|
This is indeed expected current behavior in Next.js, and you are spot on that it stems from the same architectural limitation tracked in #86785 and #64330. Why this happens despite a modern
|
Uh oh!
There was an error while loading. Please reload this page.
Summary
I'm running Next.js 16.3.0 (App Router, Turbopack) with a browserslist targeting only modern browsers, but Lighthouse still flags ~13.5 KiB of "Legacy JavaScript" on every route. Using the new
next experimental-analyzecommand, I confirmed the source ispolyfill-nomodule.js(Next.js's built-in polyfill file), not my own code or dependencies.I believe this is the same underlying issue as #86785 and #64330, where next-polyfill-module ships unconditionally regardless of browserslist config, and is only skipped at runtime via the
nomoduleattribute rather than excluded at build time.Is there a recommended way to build-time-exclude this for teams who've deliberately scoped browserslist to modern-only browsers? Or is this confirmed as expected/unfixable behavior for now?
Additional information
Example
No response
All reactions