vuex-easy-access icon indicating copy to clipboard operation
vuex-easy-access copied to clipboard

defaultMutations not work on Nuxt SSR

Open adenvt opened this issue 6 years ago • 5 comments

defaultMutations not created mutation of state on SSR, but normal on client side.

I tried

console.log(defaultMutations({
  user: '',
}))
// return {}

Info: vuex-easy-access: 3.1.5 (latest) nuxt: 2.5.1 vue: 2.6.10 node: 8.15.1 os: ubuntu 16.04

Note: i test with [email protected], it work normally

adenvt avatar Mar 27 '19 06:03 adenvt

Hi @adenvt This package is not compatible with NUXT. I personally have never used Nuxt or SSR, so if you can help me with making it compatible that would be great.

I think perhaps Nuxt doesn't allow dynamic module registration...?

mesqueeb avatar Mar 27 '19 06:03 mesqueeb

can you update this repo, latest version on npm is 3.1.5 but on github latest release is 3.0.4

adenvt avatar Mar 27 '19 07:03 adenvt

@adenvt I've updated some dependencies, pushed a new minor version, and made sure the release version here on github and npm are the same now! 😊

mesqueeb avatar Mar 27 '19 09:03 mesqueeb

i found out, isObject return false in SSR mode. I don't know what happen, but object in SSR not detected as PlainObject.

In [email protected] work normally because it use old version is-what. I will make PR for fix this issue.

adenvt avatar Mar 28 '19 14:03 adenvt

I see. We gotta be careful though, I changed that behaviour to fix other bugs, iirc

I'll see what I can do as well.

Sent with GitHawk

mesqueeb avatar Mar 28 '19 14:03 mesqueeb