Reputation: 529
I'm working on an application which I would like to add IE11 support to. I've added react-app-polyfill, mdn-polyfills and core-js as dependencies. I had a little trouble running it on Edge (Legacy version) at first, but that's up and running. I'm using Immer which seems to be the culprint for IE11 not working.
My reason for thinking this is the error [Immer] minified error nr: 19 ES5. Find the full error at: https://github.com/immerjs/immer/blob/master/src/utils/errors.ts
. The error is "Plugin not loaded". Going through the Immer documentation, then it specifies to use the function enableES5()
.
I've called enableES5()
in index.tsx, I've even moved it to the top, right underneath the polyfills imports, but the error persists. I've been going at this for a few hours now, but can't seem to figure out what is wrong, or if i'm missing something crucial.
Upvotes: 2
Views: 1023
Reputation: 529
After hours of testing and trying to figure out what the problem was, then I came across a post regarding create-react-app by a developer for Immer. Create-react-app has react-scripts which has a dependency of react-dev-util which again has a dependency to Immer. The problem is that the dependency is extremly outdated (v1.10). The devs of Immer have been pushing CRA to update the version, and they have, but it hasn't been released yet. So, for the time being, then the solution seems to be that downgrading to Immer v5.3.6 solved my problem
Upvotes: 1
Reputation: 825
Make sure that you are using the latest version of immer 7.x
Try this:
import {enableES5} from "immer"
enableES5()
Upvotes: 2