Static GitHub Issues

[1058] Generate hangs with fetch from Firebase to store

prev: asyncData method is not working when page reload
next: objects do not support the find property or method
// pages/index.vue

// ...SNIP...

fetch({ store }) {
  return firebase.database().ref('/').once('value')
    .then((snap) => {
      return store.dispatch('setDataAction');
    });
}
// store/index.js

import Vuex from 'vuex'

const store = () => new Vuex.Store({
  state: {
    data: null,
  },
  mutations: {
    setDataMutation(state, _data) {
      state.data = _data;
    }
  },
  actions: {
    setDataAction({commit}, _data) {
      return new Promise((resolve, reject) => {
        commit('setDataMutation', _data);
        resolve();
      });
    },
  },
})

export default store

Hangs after executing nuxt generate:

...
  nuxt:generate Generate file: /index.html +906ms
  nuxt:generate HTML Files generated in 12.6s +1ms
[nuxt] Generate done      # <----- Hangs here
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c923">#c923</a>)</em></sub></div>