Nuxt.js: Logs file if errors occure during nuxt generate

Created on 13 Jun 2019  路  2Comments  路  Source: nuxt/nuxt.js

What problem does this feature solve?

Hey there, I'd like to know if a feature to get logs during a nuxt generation of pages, like a log file, could be done. I have a really generic error in my project (I use Nuxt and Storyblok) when I generate my project, see the image below
Capture.PNG
And there's no way to get more information about those type of errors ,and I found nothing through the docs and the web... So could it be possible to get more informations for these generical errors ? Are they critical ? Could there be a way to log those errors ?
I already asked this as a question on the cmty app, but got no answer
Thanks!

What does the proposed changes look like?

Get more informations on every type of errors during nuxt generate

This feature request is available on Nuxt community (#c9356)
feature-request question

Most helpful comment

You can hook into either

  • generate:routeCreated to receive an error immediately when it occured or
  • generate:done, this is called after all routes have been generated and receives a list of all errors

If you use these hooks to log the errors with consola, then you can eg add stdin/stderr to a log file or you can add a consola reporter which logs to a file.

All 2 comments

You can hook into either

  • generate:routeCreated to receive an error immediately when it occured or
  • generate:done, this is called after all routes have been generated and receives a list of all errors

If you use these hooks to log the errors with consola, then you can eg add stdin/stderr to a log file or you can add a consola reporter which logs to a file.

Hey @pimlie , thanks to your steps I catched the error I was looking for, and it is now working fine during generation, thanks a lot!
The error I catched with the hook generate:routeCreated is the following: HTML minification failed. Make sure the route generates valid HTML.
And the solution for my original error is this way, as simple as it is...
Thanks again!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikekidder picture mikekidder  路  3Comments

vadimsg picture vadimsg  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments

vadimsg picture vadimsg  路  3Comments