-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vuex #2
Comments
IIRC, the webinar they had yesterday (Oct. 4th) stated that this is a "coming soon" feature. |
Any update on this feature? |
Subscribing to this |
vuejs/vuex#1404 has been merged, but Vuex has not been released since then. Once a new version gets released, it will work out of the box. |
Tried running vuex from the dev branch, but no dice. Anyone got this to work? |
@madsb No luck on my end either, this item should be prioritized higher considering VueX is a major feature utilized by nearly all VueJS applications. What are your thoughts? |
Cannot get this working either no matter what I have tried. This is critical as far as I am concerned as well for a good working development environment. Hopefully, soon! |
Agreed, would be great to have this implemented! |
https://github.com/vuejs/vuex/releases/tag/v3.1.1 released yesterday |
Can't seem to get this to work no matter what I do. I still get "No Vuex store detected." in vue-devtools. @odai-alali, did you just upgrade to 3.1.1 and it ran out of the box? |
@madsb what order are you importing Vuex/VueDevtools? I found out it sometimes matters! (VueDevtools should be before Vuex) |
@madsb Yeah, I've just updated the package version and it worked after that. This is my main.js import Vue from 'nativescript-vue';
import VueDevtools from 'nativescript-vue-devtools'
import store from './store';
import BackendService from './services/BackendService'
import Login from './screens/Login'
import Home from './screens/Home'
const backendService = new BackendService()
Vue.config.silent = (TNS_ENV === 'production');
//use devtools
if(TNS_ENV !== 'production') {
Vue.use(VueDevtools, { host: '192.168.208.125' });
}
new Vue({
components: {
Home,
Login
},
computed: {
isSoftLoggedIn () {
return backendService.isSoftLoggedId()
}
},
template: `
<Frame>
<Login v-if="!isSoftLoggedIn" />
<Home v-if="isSoftLoggedIn" />
</Frame>
`,
store,
}).$start({
getRootView(vm) {
return vm.$el.nativeView
}
}); |
I've just noticed that the state is not changing in devtools. The store is detected though. |
@odai-alali Did you ever find a solution? I'm running into the same issue |
@cjharkins unfortunately not. I switched to another project. |
I too am unable to get Vuex to load in vue-devtools. I've enabled/disabled the Vuex options under vue-devtools with no luck.
"@vue/devtools": "^5.1.0",
"nativescript-socketio": "^3.2.1",
"nativescript-toasty": "^1.3.1",
"nativescript-vue": "^2.0.0",
"nativescript-vue-devtools": "^1.2.0",
"tns-core-modules": "^5.0.2",
import Vue from 'nativescript-vue'
import store from './store';
import router from './router';
import VueDevtools from 'nativescript-vue-devtools'
if(TNS_ENV !== 'production') {
Vue.use(VueDevtools, {
host: '192.168.1.85'
})
Vue.config.devtools = true;
}
Vue.config.silent = (TNS_ENV === 'production')
new Vue({
store,
render: h => h('frame', [h(router['home'])])
}).$start()
import Vue from 'nativescript-vue';
import Vuex from 'vuex'
import { default as modules } from './modules'
Vue.config.devtools = true;
Vue.use(Vuex)
export default new Vuex.Store({
modules: modules
}) |
Seems like there has been some refactoring around Vuex in the devtools recently... It was working perfectly fine when I created the PR to vuex to allow usage in nsvue. I don't currently have time to look through the source of vuex/vue-devtools to debug why it doesn't work every time. (For me, even with the correct import order, occasionally it would not show up) |
@Wiejeben - Had been doing that, it has still yet to work. In the mean time I created several computed properties in my root component that returned the state of each store module. Ugly fix, but it works for now. |
Works for me when I update the vuex package to 3.1.1 and put the code like this way:
|
According to nativescript-vue/nativescript-vue-devtools#2 import `vuex` statement should be under `nativescript-vue-devtools` and It is true. I tested in my own.
According to nativescript-vue/nativescript-vue-devtools#2 import `vuex` statement should be under `nativescript-vue-devtools` and It is true. I tested in my own.
In my end, the issue is this |
I have exactly the same problem. I can see the store state at start up but it does not get updated when the state changes. This makes the vue tools pretty much useless. Has anyone found a solution to this? |
Once I've moved the import store line below the VueDevtools, I get a
Funny thing is that a suggestion for this problem is to put the store import above : So it becomes kind of a chicken and egg problem, not sure what else try to get the Vuex state to show up in the dev tools UPDATE: main.ts import VueDevtools from 'nativescript-vue-devtools'
Vue.use(VueDevtools)
import store from "./store/index"; // moved after the VueDevTools definitions And a fix for the |
I tried everything in this issue and I still have "No Vuex store detected" with latest version (1.4.0). Anyone has made it work? |
@sebj54 I was testing this a few days ago, using latest I also swapped the import order to be // ...
import VueDevtools from 'nativescript-vue-devtools'
// ...
Vue.use(VueDevtools)
// ...
import store from './store' and the store would show up in devtools - and I could change state, see mutation logs etc. |
I may have an issue somewhere because this is something I tried and it did not work. Maybe namespaced Vuex modules? Do you do extra steps after chaning your Does |
@sebj54 yes, a new |
I had this problem and updated the dependencies, the older template had [email protected]. It now works for me while creating a new project from template. |
Hi @rigor789, I just started a fresh new project with the latest I'll let you know if it stops working when I'll add store modules. |
Unfortunately the "No Vuex store detected" error came back. It works with submodules but it stops working once you are using With HMR, the Vuex store seems frozen. Even if I comment everything in my store (states, getters, etc.), they still appear in the Vuex pane. The opposite is also true: if I had a store module, it does not appear either. One other "funny" thing: if Vuex pane gets stuck and you run another NS-Vue app, you can see the previous app's store. It is sad because this pane is very convenient when debugging. Actually, it feels kind of "hacky" to have a consistant behavior across our views. Don't hesitate to tell me if I can help you somehow to debug this. |
Thanks @sebj54 for the info - does it still do it with hmr disabled ( The way HMR works is, it replaces chunks of your code when it changes, however it may not clean up everything properly (this is mostly handled by vue's hmr implementation, but we may be missing edge cases too). I don't currently have the capacity to dive deep and debug this - but will definitely refer back to this issue when I do - so any extra bit of info is helpful! |
works for me after moving the store import after Vue.use(VueDevtools) as advised above and applying the HTML fix here, https://stackoverflow.com/questions/58672942/htmlelement-is-not-defined-nativescript-vue vue-devtool in dev dependencies not in dependencies, vuex 3.1.1 |
Is vuex supposed to be shown when used? For me it just says "No Vuex Store detected".
The text was updated successfully, but these errors were encountered: