Hi!
Upgrading to 2.3.2 causes the error in this issue's title. This happens when the user has already visited the site and comes back. So the user has already a value stored in localStorage. This does not. The error does not happen when the value is initially written into the localStorage, only when it's read from there in the future visits.
This is an example value that is stored in localStorage by the key vuex (as seen by the Application tab in Chrome Dev tools):
{"prefs":{"showLocation":false,"locationAccepted":false,"showStops":true,"showGhosts":true,"realPhysics":false,"showFavOnStartup":false,"showOnlyFavBusses":false,"useTwoColorsForBusses":true,"singleBusColor":"vihre盲","fav":{"stop":["0505","0501","0514"],"hiddenStops":[],"stopNames":{},"busses":[],"bus":[]},"routing":{"searches":[],"saved":[]}}}
Error message in Chrome Dev Tools console:
vuex-persistedstate.umd.js:1 Uncaught RangeError: Maximum call stack size exceeded
at Array.map (<anonymous>)
at r (vuex-persistedstate.umd.js:1)
at a (vuex-persistedstate.umd.js:1)
at o (vuex-persistedstate.umd.js:1)
at vuex-persistedstate.umd.js:1
at Array.map (<anonymous>)
at r (vuex-persistedstate.umd.js:1)
at a (vuex-persistedstate.umd.js:1)
at o (vuex-persistedstate.umd.js:1)
at vuex-persistedstate.umd.js:1
I reverted back to v2.1.2 where this doesn't happen.
@piehei thanks for reporting! Can you maybe create a basic jsfiddle based on https://jsfiddle.net/robinvdvleuten/wmf8zvf8/. That really helps me pinpointing the issue!
@piehei could you please provide some more context of the issue? I cannot fix the issue if I am not able to reproduce it.
Ahh, so sorry for not getting back to you. I'll try to look into the issue this weekend and provide more info and a PR if I figure it out. Thanks for the great plugin!
Hello.
Just to add to this, I've just had the same error message for v2.3.2.
The problem seems to only occur for me when I have a firestore database reference in my states. (perhaps heavily nested objects causing the error?) I don't actually write the db state to localStorage, by excluding it from the options, paths [].
Again only occurs on page refresh when local storage already exists.
Reverting to earlier version fixes issue.
Sorry I can't be more help with the actual issue!
@piehei @pip36 can one of you guys create a very minimal reproducible jsfiddle or gist? I am not able to reproduce it myself 馃槙
Here you go.
https://jsfiddle.net/phil_23/j9qgxvcs/
@pip36 thanks for creating the fiddle! It helped me fixed the issue and will create a new release immediately!
Please see v2.4.0 for the fix of the issue
@robinvdvleuten and thank you for the quick fix!
Hi, I had the same error on "vuex-persistedstate": "^2.5.4"