Skip to content

Occasional error from React Query about structural sharing #71

Description

@achou11

Example message:

Structural sharing requires data to be JSON serializable. 

To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [["@comapeo/core-react","projects","rjncq9zpqhfu1jstk44xo4qtfc3j9kuri9der8b77qtfco3tkomy"]]: 

Error: ReferenceError: Symbol(Symbol.toStringTag) is not defined

This is coming from the usage of useSingleProject() which returns a "project client", which is a proxy instance that is created via https://github.com/digidem/rpc-reflector/.

I think it's ideal to have structural sharing enabled (docs), which allows React Query to keep the reference the same between re-renders, but maybe there's a detail I'm not understanding that allows us to disable it.

If possible, this probably would be better off with a fix in rpc-reflector as oppose to something here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions