question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] I use quiet: true but console in chrome and in terminal not empty

See original GitHub issue

Bug report

Describe the bug

I use quiet: true but console in chrome and in terminal not empty

next.config.js

module.exports = {
  quiet: true
}

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. add quiet: true to next.config.js
  2. run next.js project
  3. console will not empty

Expected behavior

console will be clear, cuz quiet = true, no webpack output, no info output, no events, no chunks, no “server startes in port 3000” output.

Screenshots

image

image

System information

  • all systems

Additional context

since next.js uses a lot of other libraries under the hood that write to the console both the browser and the server. Next.js should have a common unified interface for setting console output. and next.js would transparently pass these options to the libraries it uses

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mattcarlottacommented, Apr 22, 2020

Taking a closer look, it appears you may be debugging from the server-side stdout in chrome’s DevTools. When you view the DevTools attached to the top (localhost:3000) instead of npm, you’ll only see the console.logs you’ve written within your source code (including a few HMR messages); otherwise, no server-side event (start, build, waiting, etc) messages will be displayed.

For example:

1reaction
mattcarlottacommented, Apr 22, 2020

Looking at an older version (v8.1.0), you’re right, it looks like they are still using a custom dev-server (and not webpack-dev-server); however, the quiet option (scroll down to supported options) parameter is stated as only hiding error messages derived from the server (next-dev-server). As far as I can tell, it never silenced the event messages on the client nor server, but only emitted errors from a server response: 1, 2. This holds true for v9.3.5 as well.

As for the HMR messages, they have never been silenced in v8.1.0 nor v9.3.5, and as mentioned by Tim, they’re shown for a better development experience. Without them, you may not be aware of whether or not the files have been compiled/recompiled. That said, the logs are hard coded in development, so you can’t modify/customize them. That’s why RFC #4808 has been proposed (for custom event logging).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chrome: console.log, console.debug are not working
I've tried to re-install chrome, but it doesn't help. Here is screenshot from chrome's main page, so functions are not redefined in some...
Read more >
DevTools Debugging Tips And Shortcuts (Chrome, Firefox ...
In this article, Vitaly reviews useful features and shortcuts for debugging in Chrome, Firefox, Edge and Safari.
Read more >
How To Debug Node.js with the Built-In Debugger and ...
You will first debug code using the built-in Node.js debugger tool, setting up watchers and breakpoints so you can find the root cause...
Read more >
A Guide to Console Commands | CSS-Tricks
I'm showing these examples in Chrome with the object and array already expanded. They are normally collapsed but the output next to the...
Read more >
Start the emulator from the command line - Android Developers
While the emulator is running, you can use the Emulator console to issue ... Note: The adb utility views the virtual device as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found