infi-pc / locatorjs

https://www.locatorjs.com
1.41k stars 67 forks source link

Unable to setup with WSL2 #77

Open rekunykj opened 1 year ago

rekunykj commented 1 year ago

Hello! This seems like a fantastic tool, it's possibly user error on my end. I am attempting to run this extension with WSL2 and cannot seem to get it to work.

For reference: I am running a Windows machine with a Ubuntu-18.04 WSL2 setup. The WSL2 is where code files are stored, but the browser is running in windows.

I went ahead and added the babel plugin to .babelrc

[
      "@locator/babel-jsx/dist",
      {
        "env": "development"
      }
]

and have installed it (In node_modules @locator and its files are present.) Additionally @babel/preset-react is there as well.

I am using a custom file path vscode://file/${projectPath}${filePath}:$(line}:${column} with the regex I saw in another thread mapping file to //wsl$/Ubuntu-18.04/home/<username>/work/projects/<projects-root-directory> for reference I verified this is the correct path by scping from windows and am able to successfully access files using said path.

However when I hold alt and click on an element i see the following error

Screenshot 2022-11-21 010048

and console log output

Screenshot 2022-11-21 010100

I'm trying to figure out where the problem lies, is it a simple file path problem somehow? Is it something in the setup is missing? Any help would be appreciated this seems like a fantastic productivity tool I would love to use!

RamiroMonte commented 1 year ago

I had the same problem, but you can solve it by adding code similar to this:

locatorjs_wsl

https://github.com/infi-pc/locatorjs/issues/46#issuecomment-1206637684

ampcpmgp commented 1 year ago

How did you find this link?

RamiroMonte commented 1 year ago

@ampcpmgp I used the same link as in comment https://github.com/infi-pc/locatorjs/issues/46#issuecomment-1206637684, but adapted it to my WSL distribution

ampcpmgp commented 1 year ago

@RamiroMonte I could do the following in my environment! Thanks!

vscode://vscode-remote/wsl+Ubuntu-20.04/${projectPath}${filePath}:${line}:${column}
eStasicki commented 1 year ago

Can anyone advise me on how I can configure this extension using VSCode and WSL2 ?

Unfortunately, I tried the advice above, but still working on localhost:3000 projects - the extension does not work.

My projects directory has this path:

\\wsl.localhost\Ubuntu-18.04\home\ernest\projects

Each project I work on - is located in the "projects" folder.

Can someone help me? I am mega surprised how it works on macOS however I need to use this solution on Windows. Thanks!

@RamiroMonte @ampcpmgp @rekunykj

kokokenada commented 1 year ago

In my case WSL2 worked with vscode://vscode-remote/wsl+Ubuntu/${projectPath}${filePath}:${line}:${column} in the Custom link

viscous-coder commented 7 months ago

can someone advise the above problem solution for window also?

bruceg7333 commented 4 months ago

In my case WSL2 worked with vscode://vscode-remote/wsl+Ubuntu/${projectPath}${filePath}:${line}:${column} in the Custom link

thanks a lot, bro ! it also works for me