Nuxt.js: Nuxt generate hangs after completion

Created on 29 May 2017  路  9Comments  路  Source: nuxt/nuxt.js

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?

This bug report is available on Nuxt.js community (#c687)
pending-repro

All 9 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikekidder picture mikekidder  路  3Comments

danieloprado picture danieloprado  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments

mattdharmon picture mattdharmon  路  3Comments

lazycrazy picture lazycrazy  路  3Comments