Nuxt.js: [edge] Weird output from builder

Created on 27 Jul 2018  路  6Comments  路  Source: nuxt/nuxt.js

Version

~v1.4.0~
nuxt-edge@latest

Reproduction link

https://github.com/Freakspot/nuxt-edge-broken

Steps to reproduce

Just run node app.js.
"Test" will never be seen in the console, only "Test 2" will. Imo console.logs prior to the builder should not be cleared.

Additionally, I sometimes get huge empty chunks of whitespace, which I think sometimes happens after rendering new pages? Definitely not 100% reproducable. Also, when the builder is done doing its magic, I'll have a lot of "Compiling..." in the console which imo also shouldn't happen. See this gif: https://gph.is/2v17gSP

What is expected ?

Clean output

What is actually happening?

Unnecessary clutter, whitespace and deletion of console.logs

This bug report is available on Nuxt community (#c7448)
bug-report

Most helpful comment

I've seen this behaviour as well, we will look at it with @clarkdo, thank you @Freakspot

All 6 comments

I've seen this behaviour as well, we will look at it with @clarkdo, thank you @Freakspot

@Freakspot I suggest you using consola which is the default log utility of Nuxt and it's automatically included by Nuxt.

const { Nuxt, Builder } = require('nuxt-edge');
const nuxt = new Nuxt();
const consola = require('consola')

consola.log('Test');

async function build() {
    const builder = new Builder(nuxt);
    await builder.build();
}

build();

consola.log('Test 2');

If this doesn't solve your problem, please feel free to ping me, I'll reopen the issue.

@clarkdo Unfortunately you can't always control which logger will be used (example:other plugins/modules) :|

Using consola does indeed solve my problem _in this case_, but I have heard other complaints about this, too, and imo using consola is more of a workaround than an actual solution to this problem, similar to how @manniL stated. (console.log is also included with nuxt. :stuck_out_tongue:)

Thanks for providing this workaround tho, I really appreciate it!

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

danieloprado picture danieloprado  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

bimohxh picture bimohxh  路  3Comments

maicong picture maicong  路  3Comments