-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Edge 18 (Object.fromEntries) not supported even with correct polyfills #16715
Comments
@FBosler stacktrace available? |
Sorry, browserstack won't let me copy stuff, seems like its sandboxed. Not sure if the screenshot helps though. Thanks for looking into this. |
Any news on this? Or is there a way to monkey patch this? I am encountering a surprising large number of errors for this. |
@FBosler the fix might be to |
@samovertonjr makes sense! Thx, I'll have a look. |
@FBosler It could be caused by a non-transpiled NPM module. I'm using a few NPM modules that aren't transpiled, next-transpile-modules solved my problem. |
Check https://nextjs.org/docs/basic-features/supported-browsers-features#custom-polyfills Create // https://github.com/vercel/next.js/pull/15772#discussion_r463984612
import 'core-js/features/object/from-entries'; and import it inside your custom // https://nextjs.org/docs/basic-features/supported-browsers-features#custom-polyfills
import '../polyfills';
function App({ Component, pageProps }) {
return (
<Component {...pageProps} />
);
}
export default App; 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 (#15772 (comment), #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 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. |
Bug report
using the following
.babel.rc
leads to a build that should in theory support edge 18.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: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%20numbers 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
The text was updated successfully, but these errors were encountered: