Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[examples/with-redux-wrapper] doesn't work with "next-redux-wrapper": "7.0.2" #26338

Closed
frozar opened this issue Jun 18, 2021 · 4 comments · Fixed by #26521
Closed

[examples/with-redux-wrapper] doesn't work with "next-redux-wrapper": "7.0.2" #26338

frozar opened this issue Jun 18, 2021 · 4 comments · Fixed by #26521
Labels
examples Issue/PR related to examples good first issue Easy to fix issues, good for newcomers

Comments

@frozar
Copy link

frozar commented Jun 18, 2021

What example does this report relate to?

with-redux-wrapper

What version of Next.js are you using?

11.0.0

What version of Node.js are you using?

14.16.1

What browser are you using?

Google Chrome

What operating system are you using?

Linux Ubuntu 18.04

How are you deploying your application?

Vercel

Describe the Bug

From the directory examples/with-redux, I installed the latest version available of next-redux-wrapper, 7.0.2, as I begin to use it in my main project. After npm installation step, I launch the example npm run dev.
Compilation seems to work, but as soon as I look at the page through google chrome, I got the following error:

TypeError: nextCallback is not a function
    at /home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:146:46
    at step (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:57:23)
    at Object.next (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:38:53)
    at /home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:32:71
    at new Promise (<anonymous>)
    at __awaiter (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:28:12)
    at makeProps (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:135:16)
    at /home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:186:46
    at step (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:57:23)
    at Object.next (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:38:53)
(node:22955) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'dispatch' of undefined
    at eval (webpack-internal:///./pages/index.js:47:9)
    at /home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:143:52
    at step (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:57:23)
    at Object.next (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:38:53)
    at /home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:32:71
    at new Promise (<anonymous>)
    at __awaiter (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:28:12)
    at makeProps (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:135:16)
    at /home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:186:46
    at step (/home/frozar/wk/next.js/examples/with-redux-wrapper/node_modules/next-redux-wrapper/lib/index.js:57:23)
(node:22955) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)

Expected Behavior

I expect to be able to see the example page. The example works correctly with previous version of next-redux-wrapper, 6.0.2

To Reproduce

From examples/with-redux-wrapper directory, update next-redux-wrapper:

npm i next-redux-wrapper@^7.0.0

Launch the example:

npm run dev

Look at the page in a browser.

@frozar frozar added bug Issue was opened via the bug report template. examples Issue/PR related to examples labels Jun 18, 2021
@timneutkens timneutkens added good first issue Easy to fix issues, good for newcomers and removed bug Issue was opened via the bug report template. labels Jun 20, 2021
@ThangHuuVu
Copy link
Contributor

Hello, I'd like to take this as my first next.js contribution

@Jashnm
Copy link
Contributor

Jashnm commented Jun 23, 2021

Hey, The way next-redux-wrapper is used version 7 onwards is different from 6x.
You can follow the migration steps from here - Upgrade from 6.x to 7.x

I tried reproducing the error and 3rd step from migration steps solved it for me-

All signatures like ({store, req, res, ...}) => { ... } were changed to store => ({req, res, ...}) => { ... } in order to keep Next.js internals free of modifications and for better typings support.

@timneutkens should I update the example with-redux-wrapper with the latest changes in next-redux-wrapper ?

@leerob
Copy link
Member

leerob commented Jul 16, 2021

Fixed with #26521

@leerob leerob closed this as completed Jul 16, 2021
kodiakhq bot pushed a commit that referenced this issue Jul 16, 2021
## Bug

- [x] Related issues linked using `fixes #number`: Fixes #26338
- [ ] Integration tests added
flybayer pushed a commit to blitz-js/next.js that referenced this issue Aug 19, 2021
## Bug

- [x] Related issues linked using `fixes #number`: Fixes vercel#26338
- [ ] Integration tests added
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants