next-redux-wrapper icon indicating copy to clipboard operation
next-redux-wrapper copied to clipboard

Upgrading version of nextJS and nextjs-redux-wrapper break the demo hosted on sandbox

Open jaybe78 opened this issue 3 years ago • 2 comments

Describe the bug

A clear and concise description of what the bug is.

I've forked the sandbox demo and upgraded to

   "next": "12.0.10",
    "next-redux-wrapper": "7.0.5",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-redux": "7.2.6",

After doing this the store is undefined in getInitialProps

TypeError: Cannot read property 'dispatch' of undefined
    at Function.WrappedApp.getInitialProps (webpack-internal:///./pages/_app.tsx:30:15)
    at Object.loadGetInitialProps (/sandbox/node_modules/next/dist/shared/lib/utils.js:69:29)
    at Object.renderToHTML (/sandbox/node_modules/next/dist/server/render.js:427:31)
    at async doRender (/sandbox/node_modules/next/dist/server/base-server.js:855:38)
    at async /sandbox/node_modules/next/dist/server/base-server.js:950:28
    at async /sandbox/node_modules/next/dist/server/response-cache.js:63:36
error - pages/_app.tsx (8:14) @ Function.WrappedApp.getInitialProps
TypeError: Cannot read property 'dispatch' of undefined

Might be a duplicate of https://github.com/kirill-konshin/next-redux-wrapper/issues/444

To Reproduce

It is strongly recommended to fork CodeSandbox template https://codesandbox.io/s/next-redux-wrapper-demo-7n2t5 and create a reproducible case. It will greatly speed up debugging.

Steps to reproduce the behavior:

Just go to my fork https://codesandbox.io/s/agitated-bush-z3pr7?file=/static.tsx

Expected behavior

A clear and concise description of what you expected to happen. I expected the demo to work with latest version of nextJS, react and redux wrapper

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 6]

Additional context

Add any other context about the problem here.

jaybe78 avatar Feb 08 '22 16:02 jaybe78

any one found a workaround for this?

nuel77 avatar Feb 28 '22 23:02 nuel77

plus one i got the same errors after build. App won't start if i delete wrapper from next-redux-wrapper it works also next 12.

mefik1337 avatar Mar 15 '22 08:03 mefik1337