Edge 18 (Object.fromEntries) not supported even with correct polyfills
See original GitHub issueBug report
using the following .babel.rc
leads to a build that should in theory support edge 18.
{
"presets": [
[
"next/babel",
{
"preset-env": {
"targets": "> 0.25%"
}
}
]
],
"plugins": [
["styled-components", { "ssr": true }],
[
"module-resolver",
{
"root": ["."],
"alias": {
"@/Components": "components",
...
"@/Functions": "components/Concepts/Functions"
}
}
]
]
}
This can be confirmed by running npx browserslist "> 0.25%"
. However, when testing live via browserstack (as its pretty hard to actually install edge 18), it seems like this is not the case, as the following bug pops up:
TypeError
Object doesn't support property or method 'fromEntries'
To Reproduce
Unfortunately, it’s pretty hard for me to reliably reproduce the bug in a minimal example as I can’t even run edge 18 locally. However, navigating to https://staging-viteach.com/concepts/rational numbers with edge 18 AND logging in - no validation required - will produce the bug.
Expected behavior
Would think that the config creates the correct polyfill.
Screenshots
System information
- OS: Windows 10 (runtime)
- Browser (if applies) edge 18 (runtime)
- Version of Next.js: 9.4.4 (buildtime)
- Version of Node.js: 13.13 (buildtime)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:8
Top Results From Across the Web
Edge 18 (Object.fromEntries) not supported even with correct ...
Would think that the config creates the correct polyfill. Screenshots. image. System information. OS: Windows 10 (runtime); Browser (if applies) edge 18 ( ......
Read more >Object doesn't support property or method 'entries'
2/10/2020 UPDATE: Like @Monomachus said, first try adding this line to polyfill.ts: import 'core-js/es7/object';. If this fixes it, ...
Read more >Object.fromEntries() - JavaScript - MDN Web Docs
The Object.fromEntries() method transforms a list of key-value pairs into an object.
Read more >Angular < 13: How to support IE11 - DEV Community
I'm actually going to disagree. It was still possible to support IE11, fully, despite the polyfills and ponyfills.
Read more >Changes - HtmlUnit - SourceForge
2.53.0, September 18, 2021, Bugfixes, Chrome/Edge 93, Firefox 92 ... postMessage now supports arbitary js objects as message instead of converting them into ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Check https://nextjs.org/docs/basic-features/supported-browsers-features#custom-polyfills
Create
src/polyfills.js
:and import it inside your custom
src/pages/_app.js
:Why do we have to do this? Because Next.js does not include all polyfills. Instead @timneutkens decided to include only the most common ones (https://github.com/vercel/next.js/pull/15772#discussion_r463984612, https://github.com/vercel/next.js/issues/11714) to avoid increasing the bundle size.
Be ready for hours of IE/old Edge debugging in a VM to understand what fails (can be hard considering how basic and slow IE dev tools are).
In a regular React app without Next.js, you would simply
import 'core-js'
and be done: no worries about a npm dependency update that might introduce the use of a basic JS feature not polyfilled by Next.js.FYI Object.fromEntries() core-js polyfill is 5 lines of code.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.