Closed rezasohrabi closed 2 years ago
Hi @rezasohrabi, thanks for the kind words! I'm assuming that you didn't delete the old (compressed) cookies after setting compress
to false
and now JSON.parse
is trying to parse the compressed JSON string? Please re-open if that's not the case. Thanks!
Hello, First of all thanks a lot for this amazing wrapper. I need to persist cookie without compression, but when i change compress config to false bellow error happens:
SyntaxError: Unexpected token N in JSON at position 0 at JSON.parse ()
at Function._decodeState (/home/rezasohrabi/Desktop/node_modules/next-redux-cookie-wrapper/dist/next-redux-cookie-wrapper.cjs.development.js:170:17)
at StateCookies.getAll (/home/rezasohrabi/Desktop/node_modules/next-redux-cookie-wrapper/dist/next-redux-cookie-wrapper.cjs.development.js:204:46)
at Object.dispatch (/home/rezasohrabi/Desktop/node_modules/next-redux-cookie-wrapper/dist/next-redux-cookie-wrapper.cjs.development.js:332:40)
I am persisting user object, here is my wrapped store codes: