Home > Software design >  Is it possible to turn off console logs from "Fast Refresh" in NextJS?
Is it possible to turn off console logs from "Fast Refresh" in NextJS?

Time:08-30

When I'm doing lots of testing, it just pollutes the browser's console for me with every file save. Is it possible to turn off?

Eg.

[Fast Refresh] done in 93ms
hot-dev-client.js?1600:159 [Fast Refresh] rebuilding
hot-dev-client.js?1600:135 [Fast Refresh] done in 37ms
hot-dev-client.js?1600:159 [Fast Refresh] rebuilding
HELLO WORLD
hot-dev-client.js?1600:135 [Fast Refresh] done in 48ms
hot-dev-client.js?1600:159 [Fast Refresh] rebuilding
hot-dev-client.js?1600:135 [Fast Refresh] done in 76ms

CodePudding user response:

There's not a way to disable the console logs from appearing. You can filter them from your console, but no way to make them go away.

The specific line that prints it to the console is here, and there's no toggle/options that can be controlled/hacked/modified:

A right-click context menu higlighting the "Hide messages from hot-dev-client.js" option

This is a browser-specific setting, not something that can be done at the project level.

  • Related