Search code examples
reduxnext.js

error TypeError: (0 , _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect) is not a function


On configuring Redux with Next.js am getting this err following is my package.json versions "@reduxjs/toolkit": "^1.9.5", "next": "13.4.7", "react": "18.2.0", "react-dom": "18.2.0", "react-redux": "^8.1.1", "redux": "^4.2.1"

tried to start next.js server locally by npm run dev . But UI showing err error TypeError: (0 , _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect) is not a function


Solution

  • You are likely trying to use a component (Provider) or hook that can only be used in a client component in a server component.

    You can read up on that in the Next.js docs