VS Code node:console Fix

By  on  

I've been using Microsoft's Visual Studio Code text editor for years with great success. The app has always been stable, flexible, and the best compliment I can give it: an afterthought. Recently, however, every time I added a console.log to a JavaScript file, VS Code would add import console from 'node:console'; to the top of file.

As you could imagine, that insertion would break the build and annoy the hell out of me. My colleague Brad Decker would come to the team's rescue with the following addition to our repository:

// jsconfig.json
{
  "exclude": ["node:console"]
}

With that jsconfig.json file, VS Code would no longer import a non-existent file that broke the build. Thank you to Brad for the bug fix and productivity boost!

Recent Features

  • By
    Page Visibility API

    One event that's always been lacking within the document is a signal for when the user is looking at a given tab, or another tab. When does the user switch off our site to look at something else? When do they come back?

  • By
    Write Better JavaScript with Promises

    You've probably heard the talk around the water cooler about how promises are the future. All of the cool kids are using them, but you don't see what makes them so special. Can't you just use a callback? What's the big deal? In this article, we'll...

Incredible Demos

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!