Clicking any Local Sites launches "cli.js" in VSCODE

What issue or error are you experiencing?

Suddenly, as of about a week ago, whenever I click any of the sites in the “Local sites” sidebar, it launches a VSCode Windows 11 permission dialog, and when I click “Yes”, then VSCode launches this file called “cli.js”. I’ve not seen any help for this issue online, and AI chatbot suggestions all failed (checked for filetype associations, disabled VSCode extensions – all no-go).

I am on the latest update for LocalWP, Windows 11, and Dell. But the issue persists.

You probably aren’t going to be able to replicate the issue, but I’m hoping you can speculate what is happinging. For instance, I didn’t install cli.js and it’s unclear to me if its LocalWP that is launching it, or VSCode.

However, after I close the VSCode instance, launching the site from WP Admin button works fine. The issue only seems to occur only once (though it doesn’t matter which site I choose) until I turn local app off and on again.

Any help you can offer as to what is causing this issue is appreciated.


System Details

  • Local Version: Version 9.1.0+6719

  • Operating System (OS) and OS version:


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

OK, I think I solved it it! According to what I learned on this GitHub issue, the problem was that in Windows I had set VSCode to always open as admin, but LocalWP was normal permissions. The fix was to set LocalWP to always open as admin also.

UPDATE: 11/18/2024 - Unfortunately, setting both apps to “always admin” fixes on thing, but breaks others. I don’t remember exactly the errors I was getting, but I found that when I changed both LocalWP and VSCode to open with normal permission levels, none of the previous errors nor the new problems were present.

TL;DR: In summary, the problems are caused by having the “Runt his program as an administrator” checkbox checked on VSCode and/or LocalWP. Don’t do that.

1 Like

Thank you for sharing this @CodeSlayer2010!

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.