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

Top Indian web startups

Disclaimer: This list contains some of our team's projects Sites that are useful and usable erail.in - created by a single person and serves useful to quickly find availability in Indian trains ClearTrip - seems to be inspired by many other sites like Vayama , but able to get better UI RediffMail - speed is the big boost Myntra - good idea, but poor UI redBus - good idea, but poor UI and execution Sites from The Times Group are also of good idea, but poorly executed/architected. They clearly try and target the web startup "gap" Sites that are innovative (world's first/never seen before kind) SocialAV - World's first and only antivirus building community (by our team) CSSilize - World's first and only project management tool for slicing works (by our team) jobreapr - World's first and only fixed price job search engine (by our team)

Madurai food Vs Nagercoil food

There's huge cry that Madurai idlis are best. Having stayed in Madurai for 7-years, I can give assurance that they're crap. Madurai foods (especially available in hotels) are of poor hygiene and poor in taste. But, I always like the people--they're friendly and helping. My favorite is always Azad Hotel's (Nagercoil, near Tower Junction) chicken kothu parotta . Nagercoil food like aviyal , samba (red) rice , etc are always good and healthy as they're cooked in coconut oil and with high hygiene--even in hotels.

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