VS Code node:console Fix
Publikováno: 23.3.2021
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 […]
The post VS Code node:console Fix appeared first on David Walsh Blog.
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!
The post VS Code node:console Fix appeared first on David Walsh Blog.