locatorjs icon indicating copy to clipboard operation
locatorjs copied to clipboard

Unable to setup with WSL2

Open rekunykj opened this issue 1 year ago • 7 comments

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!

rekunykj avatar Nov 21 '22 07:11 rekunykj

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

RamiroMonte avatar Nov 21 '22 14:11 RamiroMonte

How did you find this link?

ampcpmgp avatar Nov 29 '22 09:11 ampcpmgp

@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

RamiroMonte avatar Nov 29 '22 21:11 RamiroMonte

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

vscode://vscode-remote/wsl+Ubuntu-20.04/${projectPath}${filePath}:${line}:${column}

ampcpmgp avatar Nov 30 '22 09:11 ampcpmgp

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

eStasicki avatar Apr 26 '23 09:04 eStasicki

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

kokokenada avatar Aug 03 '23 11:08 kokokenada

can someone advise the above problem solution for window also?

viscous-coder avatar Mar 27 '24 06:03 viscous-coder