Skip to main content

Solved: "Ports" Tab Not Visible in VS Code (WSL2)

None of the solutions I found on Reddit or GitHub worked, and most of the related GitHub issues were locked. So I'm documenting this here for future reference.

Problem

When using WSL2 in Visual Studio Code, the Ports tab—needed to access your application in Windows browsers like Chrome or Edge—doesn't appear. Even the Ports-related options are missing from the Command Palette.

Solution

After a lot of trial and error, here's what worked:

  1. Run npx serve in the VS Code terminal.

  2. It will output a URL such as http://localhost:3000/.

  3. Click the link (or use the Follow Link option). This will open the app in your default browser.

    You may notice that it opens on a different port (for example, http://localhost:64198). At this point, the Ports tab becomes available in VS Code.

After this initial trigger, the Ports tab seems to remain available in future VS Code sessions. The issue appears to occur only the first time you open a project in WSL2.



Disclosure:

The following ChatGPT prompt is used in this blog post:

Please fix the language of the below text and highlight the changes in bold:

Comments

Popular posts from this blog

Save American College, Madurai

This post was written in 2008 and outdated now. For update, please check Save American College, Madurai (Update 2011) Update (2011-01-16) : Save American College, Madurai (Update 2011) I'm highly privileged to have 3 degrees (B.Sc. (Spl. Physics), PGDCA and MCA) from The American College, Madurai, South India . Unlike other "commercial" colleges, American College has given room for poor students and uplifted them. And unlike other "elite" colleges who'd give seat only for "intellectuals", American College has produced geniuses. In the recent months, the saddening thing is that the college is under divide (Principal Vs. Bishop). Here is the email I sent to alumnae lately informing about the informations that I received about the developments: Update (2011-01-16) : Save American College, Madurai (Update 2011) All: I was thinking that the " Save American College " campaign was a FUD . But, when I tried to understand the problem through my...

Attraction, Status, and the Curious Pattern Behind Some Marriages

There has been a lot of discussion lately about celebrity divorces. As someone who closely observes human behavior, I have been thinking about a possible pattern behind some relationships. Before explaining my thought, I should mention something about my own background. From childhood, I was never particularly drawn to the idea of physical beauty. In fact, I even had a somewhat negative view of it. This may have come from the value systems around me while growing up. I also remember a religious gathering where someone said that a woman's beauty reflects her inner mind. Even at that time, I instinctively rejected that idea. Over the years, however, I have started noticing certain patterns in couples. When couples walk closely together, sit near each other, and interact affectionately in public, there often seems to be an interesting dynamic. In many such cases, the woman appears more attractive than the man. Sometimes she also seems more powerful in...

RTaKeyman Bookmarklet v2.0

RTaKeyman The above bookmarklet is for English to Tamil transcription. This should work like a Input Method Editor on web page forms. The first version I tried didn't work well and so this bookmarklet version. Version 2.0 2004-12-27 1.0 2004-12-12 Usage Make a bookmarklet with the above link. Point to a web page where you want to enter Tamil characters and click the bookmarklet. This will initialize the keyman for that page. Then start typing on the forms; RTaKeyman will transcribe the characters whenever it sees a space, carriage return and tab. To-do Turning on/off keyman (i.e., to enter both Tamil and English). Help and other user interfaces. Credits Sundar for informing the necessity and for being a beta tester