VS Code node:console Fix

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.


This content originally appeared on David Walsh Blog and was authored by David Walsh

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.


This content originally appeared on David Walsh Blog and was authored by David Walsh


Print Share Comment Cite Upload Translate Updates
APA

David Walsh | Sciencx (2021-03-23T11:44:45+00:00) VS Code node:console Fix. Retrieved from https://www.scien.cx/2021/03/23/vs-code-nodeconsole-fix/

MLA
" » VS Code node:console Fix." David Walsh | Sciencx - Tuesday March 23, 2021, https://www.scien.cx/2021/03/23/vs-code-nodeconsole-fix/
HARVARD
David Walsh | Sciencx Tuesday March 23, 2021 » VS Code node:console Fix., viewed ,<https://www.scien.cx/2021/03/23/vs-code-nodeconsole-fix/>
VANCOUVER
David Walsh | Sciencx - » VS Code node:console Fix. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/03/23/vs-code-nodeconsole-fix/
CHICAGO
" » VS Code node:console Fix." David Walsh | Sciencx - Accessed . https://www.scien.cx/2021/03/23/vs-code-nodeconsole-fix/
IEEE
" » VS Code node:console Fix." David Walsh | Sciencx [Online]. Available: https://www.scien.cx/2021/03/23/vs-code-nodeconsole-fix/. [Accessed: ]
rf:citation
» VS Code node:console Fix | David Walsh | Sciencx | https://www.scien.cx/2021/03/23/vs-code-nodeconsole-fix/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.