Replies: 5 comments 23 replies
-
|
did u find solution |
Beta Was this translation helpful? Give feedback.
-
|
Any update on this topic? it has been open for like >1 year at this point 👀 |
Beta Was this translation helpful? Give feedback.
-
|
no answer here ? .... |
Beta Was this translation helpful? Give feedback.
-
|
Same interest here. In bundle I see import with polyfills from |
Beta Was this translation helpful? Give feedback.
-
|
You are correct that Next.js includes some legacy JavaScript polyfills to ensure compatibility across a wide range of browsers. This can trigger Lighthouse warnings even if you are targeting modern browsers.
"browserslist": [
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 2 Safari versions",
"last 2 Edge versions"
]
const nextConfig = {
experimental: {
modern: true,
polyfillsOptimization: true
}
}
module.exports = nextConfig;
By tightening your Browserslist targets, enabling Next.js modern builds, and auditing dependencies, you can reduce or eliminate legacy JS polyfills, satisfying Lighthouse requirements while maintaining compatibility for modern browsers. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When I run Lighthouse on my application I get a warning to avoid serving legacy JS in modern browsers. Looking into the details I see the code references polyfills to
Object.entries()and the@babel/plugin-transform-classesis used.I'd tried to set a custom browserlist configuration to point to more up to date browser's versions and after running CWV I still get the same warning.
Is it possible to remove that polyfills?
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions