Meteor 1.6 server debugging with VS Code

I’ve just tried it and it works well.

Almost all posts in this thread are now obsolete. Maybe the thread should be closed. This new simple (and more reliable, it appears) way deserves a new thread, so I’ll make one now.

1 Like

Hi,

Is it possible to debug the code in share path? Studio is installed in my system, but the meteor application is setup in different machine. When I try to run debug I am getting error as UNC path not allowed.

Please help.
Thanks

Since it took my a while to get it running, I thought I’d share my setup, which is certainly not ideal:
I use windows with vscode. The whole dev stack is the linux version on WSL 1. I run vscode from Windows NOT from WSL because it causes tons of problems for me.
I simply run the meteor app normally from the wsl terminall (meteor run --inspect) and from vscode I have a simple config to connect the existing session:

{
    "version": "0.2.0",
    "configurations": [{
        "type": "node",
        "request": "attach",
        "name": "meteor debug - attach",
        "address": "127.0.0.1",
        "port": 9229,
        "localRoot": "${workspaceFolder}",
        "remoteRoot": "${workspaceFolder}",
        "skipFiles": [
            "<node_internals>/**"
        ]
    }]
}
1 Like

You might want to consider WSL 2 (either in Insider Preview now or in the May update when it becomes available) - accessing the files in the subsystem has become a lot more sane.

You simply type code . in your project directory and Visual Studio Code will open the directory, install the WSL plugin and everything is dandy from then on out. You don’t have to mess around with symlinks, you don’t have to fear file corruption and so on and so forth.

If you then want to edit/move/delete/copy/… files in the WSL you can either do explorer.exe . in the directory of your choice or open the explorer and enter \\wsl$\WSL-name\home\username (which results in the same thing)

WSL-name would be Ubuntu-18.04 for me, for example, and username would be rhywden. It’d be different on your machine, of course.

1 Like

I’ve been waiting for WSL2 to release to try it out. I’m on Pop! OS as my main driver these days, so I don’t really need Windows. Honestly, I don’t miss Windows at all. Pop! OS is friggin’ awesome! Even gaming isn’t so bad with Lutris and Steam’s Proton (and all the native ports these days). There are only a few things I miss, and they are all from macOS, not Windows (Sketch and being able to test/publish iOS apps).

1 Like

I have tried this several times and for some reason the remote mode of vscode conflicts with npm and causes me tons of issues. Not sure if they can be fixed, but from googling the problem, obviously, a lot of people face similar issues without a clear fix.
I hope things are better when wsl2 is realesed.

1 Like

I’ve been unable to get it working on a mac setup in vscode and meteor lately because it can’t find the sourcemaps with Typescript.

I’ll give it a shot when I have the time - unless you do it first. The May update is out, after all :wink: