After upgrading to react-redux version 9.1.1, our project began experiencing an error with the connect function, which is now resulting in a TypeError: connect is not a function. This issue occurs when attempting to use connect to link Redux state to a React component. The exact error message is:
Uncaught TypeError: (0 , _reactRedux.connect) is not a function
at ./node_modules/react-redux-loading-bar/build/loading_bar.js (loading_bar.js:302:1)
at options.factory (react refresh:6:1)
at webpack_require (bootstrap:24:1)
at fn (hot module replacement:62:1)
.....
Environment
React version: 18.2.0
Redux version: 5.0.1
React-Redux version: 9.1.1
React-scripts version: 5.0.1
Steps to Reproduce
Upgrade react-redux to version 9.1.1.
Start the application using npm start or yarn start.
Error occurs when the application tries to use the connect function from react-redux.
Troubleshooting Steps Tried
Checked and confirmed the correct import of connect from react-redux.
Reinstalled all node modules and cleared cache.
Checked for any typos or incorrect usage patterns with Redux-related functions and components.
Please let me know if there are any workarounds or if additional information is required to diagnose this issue further. Thank you!
Description
After upgrading to
react-redux
version 9.1.1, our project began experiencing an error with theconnect
function, which is now resulting in aTypeError: connect is not a function
. This issue occurs when attempting to useconnect
to link Redux state to a React component. The exact error message is:Uncaught TypeError: (0 , _reactRedux.connect) is not a function at ./node_modules/react-redux-loading-bar/build/loading_bar.js (loading_bar.js:302:1) at options.factory (react refresh:6:1) at webpack_require (bootstrap:24:1) at fn (hot module replacement:62:1) .....
Environment
Steps to Reproduce
react-redux
to version 9.1.1.npm start
oryarn start
.connect
function fromreact-redux
.Troubleshooting Steps Tried
connect
fromreact-redux
.Please let me know if there are any workarounds or if additional information is required to diagnose this issue further. Thank you!