Extended Set Methods (like union()
) Not Included in Default Polyfills Despite Documentation
#74976
Labels
bug
Issue was opened via the bug report template.
Developer Experience
Issues related to Next.js logs, Error overlay, etc.
Documentation
Related to Next.js' official documentation.
invalid link
The issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened.
Performance
Anything with regards to Next.js performance.
Runtime
Related to Node.js or Edge Runtime with Next.js.
Link to the code that reproduces this issue
.
To Reproduce
app/test/page.tsx
) with the following content:Open the page in Chrome 103
Observe the error:
TypeError: a.union is not a function
Add the polyfill import manually:
Current vs. Expected behavior
Current Behavior
When using Set's extended methods like
union()
without manual polyfill import, the application throwsTypeError: a.union is not a function
in Chrome 103, despite Next.js documentation stating that Set polyfills are included by default.Expected Behavior
Since Next.js documentation and source code (https://github.com/vercel/next.js/blob/canary/packages/next-polyfill-nomodule/src/index.js) include
import 'core-js/features/set'
, all Set methods including extended ones likeunion()
should work without requiring manual polyfill imports.Provide environment information
Which area(s) are affected? (Select all that apply)
Documentation, Developer Experience, Runtime, Performance
Which stage(s) are affected? (Select all that apply)
next dev (local), Vercel (Deployed), Other (Deployed), next start (local)
Additional context
Additional Context
This issue affects older browsers like Chrome 103.
From Next.js documentation:
And in polyfill source code:
The key points:
union()
work fine in server componentsThe text was updated successfully, but these errors were encountered: