I'm running into the issue where nuxt will hang after running yarn generate on a small site:
nuxt:generate Destination folder cleaned +30s
nuxt:generate Static & build files copied +29ms
nuxt:render Rendering url / +3ms
nuxt:render Rendering url /terms +53ms
nuxt:render Rendering url /privacy +9ms
nuxt:generate Generate file: /index.html +590ms
nuxt:generate Generate file: /terms/index.html +78ms
nuxt:generate Generate file: /privacy/index.html +40ms
nuxt:generate HTML Files generated in 31.1s +4ms
[nuxt] Generate done
Nuxt hangs, so if i wanted to run something like yarn generate; yarn serve, yarn serve is never run.
Any ideas what may be causing this?
Shouldn't it be && @peitalin
@peitalin Are you using something like Firebase or similar that is opening a socket which keeps open?
Hmm, or maybe because of watchers ? https://nuxtjs.org/api/configuration-watchers/#the-watchers-property @florianwittmann
Maybe we need a generateDone event/hook to be able to provide some function in nuxt.config.js for socket closing and other cleanup stuff?
I'm not using anything with sockets at the moment; the sites a a landing page with basic JavaScript functionality.
Please attach some code example, so we can reproduce it @peitalin
It seems getting Firebase data in asyncData might cause nuxt generate to hang.
This glitch demonstrates the issue (I think): https://glitch.com/edit/#!/nuxtjs
Its asyncData code is:
asyncData: function(context, callback) {
firebase.database().ref('/').once('value').then(function(snap) {
console.log("Data from Firebase: " + JSON.stringify(snap.val(), null, 2));
callback(null, snap.val());
});
}
and runs: nuxt generate; ls -lht dist; echo Done
But "Done" never shows up!
I did a clean git clone, yarn install, yarn generate of my repo and the issue is no longer there.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.