Description: Nanostores persistent storage breaks with bfcache (using browser back button). Project using Astro Framework (SSR), Vue 3 and Nanostores + Nanostores persistent and deploying to Netlify.
- Clone project
- Run
npm i
- Install Netlify, follow instructions here [https://docs.astro.build/en/guides/deploy/netlify/](Astro Framework Netlify instructions)
- Replace
yoursitehere
line 9 in package.json with your site namesite: "https://yoursitehere.netlify.app/",
- Build and deploy to Netlify
netlify deploy --build --prod
- Your netlify site will be ready to test...
- Go to route
/setuser
and enter something into the input field - Use the browsers
back
button to return to the previous page and confirm that the input value you entered hasn't been updated from localStorage. - If you open developer tools, you'll see that the value of localStorage has been correctly logged via JavaScript and inside localStorage you'll find the correct value as well, but the Vue component still shows the old value from localStorage.