Vuex store state emptied on reload when using vite
Environment
From the codesandbox
------------------------------
- Operating System: `Linux`
- Node Version: `v14.18.1`
- Nuxt Version: `2.16.0-27272174.ab1c6cb4`
- Package Manager: `[email protected]`
- Bundler: `Webpack`
- User Config: `bridge`, `buildModules`
- Runtime Modules: `-`
- Build Modules: `@nuxt/[email protected]`
------------------------------
Describe the bug
When using vite with nuxt-edge and bridge, it seems the store state behaves inconsistently.
Setting bridge: { vite: true } causes the store state to be as expected on first page load, but after reloading the store state is empty. Triggering a server rebuild by changing content causes the store state to be set on the next page load, but reloading the page returns and empty store state again.
Setting bridge: { vite: false } cause the store state to behave as expected, the store state contains the values on every page load.
Reproduction
https://codesandbox.io/s/nervous-sunset-277b7?file=/pages/index.vue
Additional context
No response
Logs
No response
Do you still encounter this? I can't now reproduce with your sandbox: https://codesandbox.io/s/epic-elion-siyj7d
Testing both sandboxes the bug occurred as described on Chrome (Version 106.0.5249.103), yet on Firefox (Version 105.0) the store was empty from the get go, all done on Ubuntu 20.04.5 LTS.