redux-persist icon indicating copy to clipboard operation
redux-persist copied to clipboard

redux-persist/createPersistoid: error serializing state TypeError: Converting circular structure to JSON

Open Progressive-Programmer opened this issue 3 years ago • 3 comments

Trying to save socket.io instance in reducer this error message pops continuously

This is how we are dispatching the socket instance

      const socket = io(baseURL, { auth: { token } });
      dispatch(socketConnectAction(socket))
      
      
index.js:1 redux-persist/createPersistoid: error serializing state TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Socket'
    |     property 'io' -> object with constructor 'Manager'
    |     property 'nsps' -> object with constructor 'Object'
    --- property '/' closes the circle
    at JSON.stringify (<anonymous>)
    at defaultSerialize (createPersistoid.js:126)
    at processNextKey (createPersistoid.js:71)

Progressive-Programmer avatar Jun 30 '21 17:06 Progressive-Programmer

Any update on this?

graceydev avatar Apr 08 '24 16:04 graceydev

redux-persist/createPersistoid: error serializing state TypeError: Converting circular structure to JSON --> starting at object with constructor 'EventEmitter' | property '_events' -> object with constructor 'Events' | property 'change' -> object with constructor 'EE' --- property 'context' closes the circle

yuanfa0620 avatar Jul 26 '24 02:07 yuanfa0620

redux-persist/createPersistoid: error serializing state TypeError: Converting circular structure to JSON --> starting at object with constructor 'EventEmitter' | property '_events' -> object with constructor 'Events' | property 'change' -> object with constructor 'EE' --- property 'context' closes the circle

yuanfa0620 avatar Jul 26 '24 02:07 yuanfa0620