redux-toolkit: RangeError: Maximum call stack size exceeded at Array.map
Hello,
New to Redux toolkit here. The following error generated in my terminal was encountered when initializing a project with “npx create-react-app --template redux” or when I followed the quick start guide.
Seems anyway I approach using Redux toolkit right now, I am running into the following error.
Failed to compile.
RangeError: /Users/michaeltran/side-projects/testapp/node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js: Maximum call stack size exceeded
at Array.map (<anonymous>)
at Array.map (<anonymous>)
at Array.map (<anonymous>)
assets by path static/ 1.65 MiB
asset static/js/bundle.js 1.65 MiB [emitted] (name: main) 1 related asset
asset static/media/logo.b2e5a01e505f739f1484b881277d5186.svg 1.1 KiB [emitted] (auxiliary name: main)
asset index.html 1.68 KiB [emitted]
asset asset-manifest.json 278 bytes [emitted]
cached modules 1.49 MiB [cached] 151 modules
runtime modules 28.1 KiB 13 modules
./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js 39 bytes [built] [1 error]
ERROR in ./node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
RangeError: /Users/michaeltran/side-projects/testapp/node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js: Maximum call stack size exceeded
at Object.decode (/Users/michaeltran/side-projects/testapp/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js:36:20)
at new TraceMap (/Users/michaeltran/side-projects/testapp/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js:187:48)
at /Users/michaeltran/side-projects/testapp/node_modules/@ampproject/remapping/dist/remapping.umd.js:230:26
at Array.map (<anonymous>)
at build (/Users/michaeltran/side-projects/testapp/node_modules/@ampproject/remapping/dist/remapping.umd.js:206:42)
at /Users/michaeltran/side-projects/testapp/node_modules/@ampproject/remapping/dist/remapping.umd.js:230:20
at Array.map (<anonymous>)
at build (/Users/michaeltran/side-projects/testapp/node_modules/@ampproject/remapping/dist/remapping.umd.js:206:42)
at /Users/michaeltran/side-projects/testapp/node_modules/@ampproject/remapping/dist/remapping.umd.js:230:20
at Array.map (<anonymous>)
@ ./src/app/store.js 3:0-50 5:21-35
@ ./src/index.js 8:0-36 14:11-16
webpack 5.69.0 compiled with 1 error in 7247 ms
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 15 (4 by maintainers)
Pinning
"@babel/core"
down to"7.17.2"
seems to solve the problem for me. Time to open a ticket I guess?Because of the above, running
npm update @babel/core
in react root folder fixes the issue.This seems due to a dependency of a dependency that updated today. I’m still trying to track it down.
These are the candidates I have identified to be updated today:
I also encounter the same issues here.
My package.json
and the error when starting the project:
https://github.com/michaelhtran120/react-app-redux-toolkit
I made no changes to the files after running
"npx create-react-app _appname_ --template redux"
The upstream Babel issue has been fixed in
7.17.4
.