question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getServerSideProps in redux-saga example in Next.js repo

See original GitHub issue

I try to use the getServerSideProps in redux-saga example. If I just replace getStaticProps with getServerSideProps, then my code does not work - placeholderData is not loaded. Why does the example stop working after the replacement?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
todortotevcommented, Jun 7, 2020

@edshav you can try the updated version in with-redux-saga @ nextjs repo

1reaction
0xgenoskwacommented, Jun 16, 2020

// 2. Stop the saga if on server if (ctx.req) { ctx.store.dispatch(END); await (ctx.store as SagaStore).sagaTask?.toPromise(); } comment above code at _app.js will work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data Fetching: getServerSideProps - Next.js
API reference for `getServerSideProps`. Learn how to fetch data on each request with Next.js.
Read more >
how to use typescript, next-redux-wrapper, getServerSideProps?
Here is one solution, based on the next-redux-wrapper docs: ... title="Home | Next.js + TypeScript Example"> <h1>Hello Next.js </h1> <p> ...
Read more >
Next.js With Redux Saga Example - StackBlitz
Run official live example code for Next.js With Redux Saga, created by Vercel on StackBlitz. ... repository-url=https://github.com/vercel/next.js/tree/.
Read more >
Redux Wrapper for Next.js - Morioh
Each time when pages that have getStaticProps or getServerSideProps are opened by user ... Or like this (from with-redux-wrapper example in Next.js repo):...
Read more >
How to use Redux in Next.js - LogRocket Blog
For this reason, many projects that use Next.js want to take ... or the getStaticProps or the getServerSideProps functions are called, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found