Home > Software engineering >  VSCode live preview: many extraneous logs
VSCode live preview: many extraneous logs

Time:10-15

When I use the built-in Live Preview: Start Server and open dev tools (via the hamburger menu), I get lots of extra logs that don't occur in an external browser.

As I type console, for instance, when I type the c I get an error log c is not defined, then the same for co and con and cons all the way up until the word console is complete, filling up the devtools with nonsense logs. This does not happen in an external browser.

How can I suppress all these intermediary logs? I'd be happy with either a debouncing strategy, or a way to only refresh the page on save.

CodePudding user response:

You could set an auto save delay.

Autosave has multiple modes. One of which is "afterDelay." If you set a delay, it will give you more time to type a line of code.

To make this change, you can set it like this:

  1. Open the settings. It's under File > Preferences > Settings in Windows, or Code > Preferences > Settings in macOS.
  2. Search for "autosave."
  3. Change the Auto Save setting to afterDelay.
  4. Change the Auto Save Delay setting to the number of milliseconds to wait before saving. For example, setting it to 5000 will delay the save for five seconds.

More information about configuring autosave.

  • Related