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

No HYDRATE action dispatched #544

Open
samends opened this issue May 3, 2023 · 0 comments
Open

No HYDRATE action dispatched #544

samends opened this issue May 3, 2023 · 0 comments
Labels

Comments

@samends
Copy link

samends commented May 3, 2023

Describe the bug

For pages not returned in the list of slugs on initial call of getStaticPaths (for example, a new page added or a non existent page), no HYDRATE action is dispatched when I use incremental regeneration with getStaticPaths with fallback set to true. No HYDRATE action leads to the server side state not getting propagated to client side state for those particular pages

The following is the dependency versions I was using when seeing this issue

    "@types/node": "14.0.5",
    "@types/react": "18.0.27",
    "@types/react-dom": "18.0.10",
    "@types/react-redux": "7.1.25",
    "@types/webpack-env": "1.15.2",
    "next": "12.3.1",
    "next-redux-wrapper": "8.1.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-redux": "7.2.9",
    "redux": "4.0.1",
    "typescript": "4.8.4"

To Reproduce

To reproduce use the codesandbox I created and go through the following steps:
Link to codesandbox

Steps to reproduce the behavior:

  1. Once in codesandbox click the "Open Navigator" button

Screen Shot 2023-05-03 at 1 55 59 PM

2. Add `/testPage` to the URL

step2

3. Notice how the `page` state is still `init` and not `testtest` as it should be showing as `getStaticProps` in the `slug.tsx` file dispatches an action with the payload `testtest`

step3

step4

Note that if you use the page link to get to the test page you do not see this issue. This is likely because when a page with fallback: true is navigated to through next/link or next/router (client-side) Next.js will not serve a fallback and instead the page will behave as fallback: 'blocking'.
step5
step6

@samends samends added the bug label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant