Redux-toolkit: Error "'enableES5' is not exported from 'immer'" in v1.3.x

Created on 3 Apr 2020  路  4Comments  路  Source: reduxjs/redux-toolkit

I'm updating @reduxjs/toolkit from v1.2.4 to the latest v1.3.2 in a Create-React-App and the build fails with this error message:

./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js
Attempted import error: 'enableES5' is not exported from 'immer'.

I also tried v1.3.0 and v1.3.1 but both give me the same problem, so I guess it has something to do with [email protected].

I'm using the latest [email protected] with [email protected].

Does anyone have any idea of what might be happening?

Thanks!

Most helpful comment

I fixed it with yarn add immer and adding this at the top of the file where I have the configureStore() call:

import { enableES5 } from 'immer';
enableES5();

All 4 comments

Thanks a lot @phryneas! I'll follow the issue on https://github.com/facebook/create-react-app/issues/8750

I fixed it with yarn add immer and adding this at the top of the file where I have the configureStore() call:

import { enableES5 } from 'immer';
enableES5();

I fixed it with yarn add immer and adding this at the top of the file where I have the configureStore() call:

import { enableES5 } from 'immer';
enableES5();

tnx

Was this page helpful?
0 / 5 - 0 ratings