-
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
solution for Next Js in IE11 after add Polyfills #7993
Comments
Going to close this as it doesn't follow the issue template. |
Hi @anwar-kalghoum I am also facing issue on IE 11, my Next.js site doesn't work in this browser. So did you got it working with your polyfill in IE, if Yes, could you please share the approach which you took. Thanks |
Interesting timing. I also just started getting issues with IE11 on my site today. |
Hi anyone find a solution to this? |
I made following changes in my Next.js typescript project and that worked, as per Next.js docs it supports IE11 browser but for external npm modules when you use it in your Next.js project, you have to add polyfill for those manually .babelrc
next.config.js
package.json
Added new file - src/client/polyfill.js
|
Great thanks a ton @dineshmatta |
In my case, the culprit was an incompatible 3rd party package, a really old version of |
@erango how did you debug this to know this package was the issue? |
Most of the above polyfills are not needed currently. On top of that this will replace the need for it: #10212 |
@timneutkens It's merged now? I mean is it available in the latest version of nextjs? |
@shakesBeardZ it's available on |
@Timer It's fixed in |
Nope, you only need to upgrade to |
EDIT: I published a reproducible demo at https://github.com/dawsbot/with-polyfills-app @Timer After an update to Potential SolutionsSomething similar was listed in Is this the correct place to report this? I want to follow your guidelines because y'all handle a massive amount of incoming message and bug reports 🙏 |
@dawsbot can you please provide a reproducible demo? We have integration tests for IE11 that are currently passing! |
@Timer I reproduced it in the Nextjs examples! It happens when you try to use a polyfill of just |
same syntax error in regexp issue with @dawsbot on IE 11 |
@dawsbot I assume that double-triggers core-js related things, as said adding that core-js import is not needed as Next.js 9.3 will automatically load all polyfills needed for IE11, see this list: https://github.com/zeit/next.js/blob/canary/packages/next-polyfill-nomodule/src/index.js Importing |
This comment has been minimized.
This comment has been minimized.
@GianfrancoCorrea your comment is not actionable. Please provide a reproduction. |
I understand that importing all of With this said, there is a community response here where SOME of us are still breaking IE11, and whether that's on us or NextJS, we're stumped and are reaching out for help. I'm not sure what else to try, but SOME polyfills are required in our app and picking out each one individually from |
I'm just saying that you're sending bloated JavaScript bundles to all your users if you take that approach. Basically the polyfills that you load "just importing core-js" will be 2x the size of ReactDOM
Providing a reproduction that can be looked into that doesn't use the polyfills example would be a start. Note the provided example is just showing you adding all polyfills, not which polyfills are missing. |
Understood, thanks for the issue support on this @timneutkens . I've created an issue report for one polyfill problem we're having since removing |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Question about Next.js in IE11
I added Polyfills in my project nextjs, but all the scripts js are not functional in IE11 (internet explorer):
https://github.com/zeit/next.js/tree/canary/examples/with-polyfills
// polyfills.js
/* eslint no-extend-native: 0 */
// core-js comes with Next.js. So, you can import it like below
import includes from 'core-js/es/string/virtual/includes';
import repeat from 'core-js/es/string/virtual/repeat';
import assign from 'core-js/es/object/assign';
// add your polyfills
// This files runs at the very beginning (even before React and Next.js core)
console.log('Load your polyfills');
String.prototype.includes = includes;
String.prototype.repeat = repeat;
Object.assign = assign;
// next.confg.js
`require('dotenv').config();
const path = require('path');
const Dotenv = require('dotenv-webpack');
const withCSS = require('@zeit/next-css');
console.log(__dirname);
module.exports = withCSS({
cssLoaderOptions: {
url: false,
},
distDir: '../build',
pageExtensions: ['jsx', 'js'],
webpack: config => {
const originalEntry = config.entry;
config.entry = async () => {
const entries = await originalEntry();
},
});
`
The text was updated successfully, but these errors were encountered: