title: Vuex module not accessible from rootState
body: <p>I needed to get route's query parameters inside Vuex in order to preload filter settings and update the state of the application. To make this possible I installed <a href="https://github.com/vuejs/vuex-router-sync" rel="nofollow noreferrer">vuex-router-sync</a>. </p>
  
  <p>Next step was to synchronize the Vuex and VueRouter.</p>
  
  
  
  <p>Router:</p>
  
  <pre class="lang-js prettyprint-override"><code>Vue.use(VueRouter);
  export default new VueRouter({ mode: 'history' });
  </code></pre>
  
  <hr>
  
  <p>Store:</p>
  
  <pre class="lang-js prettyprint-override"><code>Vue.use(Vuex);
  export default new Vuex.Store({
      modules: { filters: FiltersModule },
      plugins: [ FiltersPlugin ]
  });
  </code></pre>
  
  <hr>
  
  <p>App's bootstrap:</p>
  
  <pre class="lang-js prettyprint-override"><code>const unsync = sync(store, router);
  new Vue({
      el: '#restaurant-admin-app',
      components: {
          'App': AppComponent,
          'filters': FilterComponent,
          'orders-table': OrdersTableComponent
      },
      store,
      router
  });
  </code></pre>
  
  <hr>
  
  <p>My <code>FilterPlugin</code> that should trigger the URL parsing:</p>
  
  <pre class="lang-js prettyprint-override"><code>export default store =&gt; {
      store.dispatch('filters/parseURLFilterSettings');
  }
  </code></pre>
  
  <hr>
  
  <p>And now, the funny part, here's the URL parsing action: </p>
  
  <pre class="lang-js prettyprint-override"><code>parseURLFilterSettings: ({ state, commit, rootState }) {
      console.log('RootState:',                rootState);
      console.log('Route module (incorrect):', rootState.route);
      console.log('Filters module (correct):', rootState.filters);
      console.log('Object\'s keys:',           Object.keys(rootState));
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/SFmErm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SFmErm.png" alt="Console log output"></a></p>
  
  <p>What am I doing wrong? I thought it might be something with syncing, but at the end the console.log shows clearly that the route Object is there (and it's not empty), but somehow when I access it, it's <code>undefined</code>. Thank you in advance.</p>