davestewart / vuex-pathify

Vue / Vuex plugin providing a unified path syntax to Vuex stores
https://davestewart.github.io/vuex-pathify
MIT License
1.37k stars 57 forks source link

Unable to expand wildcard path Nuxt Js #111

Closed sinangulsever closed 4 years ago

sinangulsever commented 4 years ago

Unable to expand wildcard path 'userbilgi/*':

Nuxt component image

Store folder image

Store module image

Console error image

Why does this problem occur?

davestewart commented 4 years ago

Hey. Did you check the order of your store and router imports as the error suggests?

sinangulsever commented 4 years ago

" - Make sure the store is imported before the router, then reload" how can i do this in nuxt js

sinangulsever commented 4 years ago

Vuex

image

davestewart commented 4 years ago

Oh crap, I forgot about Nuxt!

Not 100% sure about this one (it's been a long time since I looked at the source) but can you try making the module and its calls, namespaced? Do you know how to do that?

PS. easier to post real code then I can make alterations and post back.

davestewart commented 4 years ago

OK - it seems this might b a bug in Nuxt that is still not fixed:

The solution is to NOT use wildcards.

This will make your code clearer, anyway.

Wildcards are useful, mainly for large options sets, but better to make your code explicit.

sinangulsever commented 4 years ago

I removed the wildcard characters. image

Component image

This time it gave a different error image

davestewart commented 4 years ago

Ah, sorry... you will need to specify the properties manually (rather than using the * character, which effectively says "please get all properties"), so:

computed: {
  ...sync('userbilgi', [
    'name',
    'lastname',
  ])
}