I just downloaded the last version of redux-toolkit and get the next issue while trying to use it in my project based on CRA.
Failed to compile
./node_modules/immer/dist/index.js
Module not found: Can't resolve './immer.cjs.development.js' in '/Users/echuvelev/Code/trust/trust-client/node_modules/immer/dist'
This error occurred during the build time and cannot be dismissed.
index.js:7 Uncaught Error: Cannot find module './immer.cjs.development.js'
at webpackMissingModule (index.js:7)
at Object../node_modules/immer/dist/index.js (index.js:7)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Module../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js (0.chunk.js:28)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Module../src/reducers/auth.ts (auth.ts:1)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Module../src/reducers/index.ts (index.ts:1)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Module../src/index.tsx (index.css?f3f6:45)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Object.1 (api.ts:12)
at __webpack_require__ (bootstrap:784)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
webpackMissingModule @ index.js:7
./node_modules/immer/dist/index.js @ index.js:7
__webpack_require__ @ bootstrap:784
fn @ bootstrap:150
./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js @ 0.chunk.js:28
__webpack_require__ @ bootstrap:784
fn @ bootstrap:150
./src/reducers/auth.ts @ auth.ts:1
__webpack_require__ @ bootstrap:784
fn @ bootstrap:150
./src/reducers/index.ts @ index.ts:1
__webpack_require__ @ bootstrap:784
fn @ bootstrap:150
./src/index.tsx @ index.css?f3f6:45
__webpack_require__ @ bootstrap:784
fn @ bootstrap:150
1 @ api.ts:12
__webpack_require__ @ bootstrap:784
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
index.js:1 ./node_modules/immer/dist/index.js
Module not found: Can't resolve './immer.cjs.development.js' in '/Users/echuvelev/Code/trust/trust-client/node_modules/immer/dist'
package.json
{
"name": "trust",
"version": "0.1.0",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^1.4.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/jest": "^24.0.0",
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"@types/react-input-mask": "^2.0.5",
"@types/react-redux": "^7.1.9",
"@types/react-router-dom": "^5.1.6",
"axios": "^0.20.0",
"classnames": "^2.2.6",
"dotenv": "^8.2.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-hook-form": "^6.9.4",
"react-input-mask": "^2.0.4",
"react-redux": "^7.2.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"redux": "^4.0.5",
"typescript": "~3.7.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Immer had a bad published package on their end. The latest version _should_ fix that, or pin Immer to 7.0.9.
Most helpful comment
Immer had a bad published package on their end. The latest version _should_ fix that, or pin Immer to
7.0.9.See https://github.com/immerjs/immer/issues/685 .