Skip to content
Source
Sign inSign up
TanStack/query

[V3]: SSR with NextJs - undefined cannot be serialized as JSON #1370

Closedtatchi(GitHub profile, opens in a new tab) opened this issue 3 comments

Hey,

I've been trying to update a NextJs repo which uses hydration to V3 and got the following error:

image

Quickly looking at the code and there's indeed a fetchMeta state property set by default to undefined.

https://github.com/tannerlinsley/react-query/blob/4d01e1fd543d304d2b07defcd4cda55e089db88b/src/core/query.ts#L442

  1. :tada: This issue has been resolved in version 3.2.0-beta.33 :tada:

    The release is available on:

    Your semantic-release bot :package::rocket:

  2. tannerlinsley added labelsreleased on @beta

  3. This seems NextJS specific as usually undefined will just be dropped when serializing to JSON:

    JSON.stringify({ prop: undefined })
    // {}
  4. Yeah, it must be next specific. I ran into it yesterday nonetheless. Not a big deal though.

  5. tannerlinsley closed this

Sign in to join this conversation.