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

Humble Award - Dr. A.N. Sreevatsan

Dr. A.N. Sreevatsan , ENT specialist located in Adyar, Chennai is one of the gems available in medicines. No assistants in his consulting room and he'd take at least 15mins for every patients. So far I have referred many and all are happy with his approach. Every wannabe doctor should visit him personally to understand his approach. I wish him to be more famous than now. Update (2010-11-21) : Added link to Google Map Keywords : Sreevatsan, Srivatsan, ENT, Adyar, Chennai, Hospital, Doctor

Zac Brown Band rocks...

When I was doing UG, my super-senior friend Ronald introduced me to MLTR and I was totally taken away by the music then. About 15-years later, I'm feeling same ecstasy when listening to Zac Brown Band 's Whatever It Is and Highway 20 Ride . The voice and music are amazingly cool.

Open source PHP frameworks and problems

I was using CakePHP for sometime and proposed CakePlus , another UIMS toolkit on the top of CakePHP but also altering some problematic core of it. The thread should explain the outcome of the post. And, then I noted Akelos framework has most of the things built in. Issues with frameworks esp. CakePHP Scalability not a priority - Developers aren't aware that we can't throw more and more hardware Excessive use of regular expressions Evangelist isn't aware that the framework throws many queries unnecessarily More memory consumption - 100M would never be enough for a simple project Poor coding standards and practices - Prolong use of extract() often leads to more memory consumption Can't use the native approaches or baked codes. The override approach always lead to hard to debug codes Poor architected codes and no clear defined approaches. People belong to the cult drives the direction and often throws unprofiled codes. No native provision to share codes between M-V-C and...