Closed fritz-c closed 1 year ago
Thanks for contributing! I think it should be taken care of by next/babel
. Do you use a custom babel file, and can you check if it's happening too with only a bare Next.js project?
I wasn't using a custom babel file. Here is an minimal reproduction repo: https://github.com/fritz-c/next-routes-ie
I suppose the issue with next/babel
could be traced back to one of these changes: https://github.com/zeit/next.js/commits/ebf0c47c25541cfc50c8f319141f4bc9f47daeb8/server/build/babel/preset.js
I am seeing the same issue in IE11, and my custom babel file is below: (I need it for the test framework)
{
"env": {
"development": {
"presets": ["next/babel"]
},
"production": {
"presets": ["next/babel"]
},
"test": {
"presets": [["next/babel", { "preset-env": { "modules": "commonjs" } }]]
}
}
}
Including a polyfill in my Layout component works for now but isn't optimal.
As stated in the Next.js docs, you should handle polyfills yourself. There is an example showing how to do it. See:
https://github.com/zeit/next.js#browser-support
Perhaps a warning in the docs would suffice?
If we can easily switch out Object.assign and avoid babel configuration issues with no additional ongoing maintenance I'd argue that it makes sense? I'd forgotten I added the polyfill but this is something I'll be coming back to resolve soon, whether it be with babel or a fork of this repo.
I agree with @stevokk. Let's just replace Object.assign with a local helper or something. Rather that than dabble with configuration.
This method isn't supported by Chrome 41 (googlebot!) and IE 11 (~3% of the global traffic). I think that it's important.
When the bundle was created by babel, calls to Object.assign were being left as-is, causing errors in IE 11 that left the user staring at a blank screen.
Fixes #142