-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Next bundles language features newer than what browserlist should allow #45473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I updated the repro to use the latest next canary (13.1.7-canary.21). The issue is still there. |
@karl-run Did you resolve this? Facing the same issue, we're at next(13.0.0) |
It's still an issue. It actually caused some downtime for Safari 12 users again because filter-obj snuck it's way into a different app through a transitive dependency. 😩 |
This is still an issue. I've had to be creative, because we don't notice right away when a dependency or transitive dependency breaks the app for Safari 12 users. |
I still have this issue. |
I'm running into the same issue -- using es-check is one way I'm trying to identify. But even a vanilla app created on v15 seems to illustrate the issue: https://github.com/mobius-academy/transpile-repro The check is to run |
Uh oh!
There was an error while loading. Please reload this page.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
SWC transpilation
Link to the code that reproduces this issue
https://github.com/karl-run/next-bundle-bug-repro
To Reproduce
yarn && yarn build
.next/static/chunks/pages/index-<hash>.js
has the following operator:?.
included in the bundle.Describe the Bug
When a library ships unsupported language features, for example optional chaining operator (not supported on Safari 12), Next will still bundle this operator, even though the default browser list says Safari 12+.
A more specific scenario is that filter-obj uses the optional chaining operator, and this was accidentally included in our bundle as part of a transitive of a transitive of a transitive dependency, so users on older iPhones suddenly started seeing white pages (except for the parts that were SSR-ed).
I have checked the behavior of other build pipelines, and default Vite and CRA setups both transpile away this operator when building for production.
We feel that this is a pretty serious bug, because it happens without any warning/crashing build. Even if the build would yell at me, so I could add
transpilePackages: ['filter-obj']
tonext.config.js
. But as it stands today, I won't know until someone discovers it.Expected Behavior
That no language features above what browserlist should allow end up in my production bundle, even though it comes from a library.
The text was updated successfully, but these errors were encountered: