Next.JS SSG broken with Redux Persist

866 views Asked by At

I am trying to get SSG working along with Redux Persist but sadly <div id="__next"></div> is always empty even when I use Redux Persist.

Expected: (Without Redux Persist) - Works perfectly, the data appears in the DOM from the store. image

Getting: (With Redux persist) - Persists perfectly, but __next div is always empty therefore making it non-SEO friendly and voids the point of doing SSG.
image

I am using getStaticProps to fetch the data and dispatch actions on the store within getStaticProps. My getStaticProps implementation with and without redux persist is of the form:

export const getStaticProps = wrapper.getStaticProps(
  async ({ params, store }) => {
store.dispatch({type:"SOME_TYPE",payload:{}})
});

Any help would be appreciated.

0

There are 0 answers