bridge icon indicating copy to clipboard operation
bridge copied to clipboard

Vuex store state emptied on reload when using vite

Open BobbieGoede opened this issue 4 years ago • 2 comments

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

BobbieGoede avatar Nov 08 '21 10:11 BobbieGoede

Do you still encounter this? I can't now reproduce with your sandbox: https://codesandbox.io/s/epic-elion-siyj7d

danielroe avatar Jul 10 '22 06:07 danielroe

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.

LesserWords avatar Oct 11 '22 15:10 LesserWords