Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fix port undefined #23

Closed
anasrar opened this issue Jan 7, 2023 · 7 comments · May be fixed by #25
Closed

How to fix port undefined #23

anasrar opened this issue Jan 7, 2023 · 7 comments · May be fixed by #25

Comments

@anasrar
Copy link

anasrar commented Jan 7, 2023

Do not use latest commit https://github.com/microsoft/vscode-js-debug . use v1.74.1.

Error

[dap-js] JS Debugger stderr:
[dap-js] JS Debugger stderr: /path-to/vscode-js-debug/src/vsDebugServer.ts:93                                                                                                                 
    console.log((result.server.address() as net.AddressInfo).port.toString());                                                                                                                                                                
                                                                 ^                                                                                                                                                                            
TypeError: Cannot read properties of undefined (reading 'toString')                                                                                                                                                                           
    at VsDebugServer.launchRoot (/path-to/vscode-js-debug/src/vsDebugServer.ts:93:66)                                                                                                         
    at processTicksAndRejections (node:internal/process/task_queues:95:5)     
[dap-js] JS Debugger exited with code 1! 

Manually

git clone https://github.com/microsoft/vscode-js-debug
cd vscode-js-debug
git pull
git fetch --all --tags
git checkout tags/v1.74.1
npm install --legacy-peer-deps
npm run compile
@JbIPS
Copy link

JbIPS commented Jan 9, 2023

With Packer

use {
  "microsoft/vscode-js-debug",
  opt = true,
  run = "npm install --legacy-peer-deps && npm run compile",
  tag = 'v1.74.1'
}

@mxsdev
Copy link
Owner

mxsdev commented Jan 11, 2023

Thanks for this! And @JbIPS for the packer config.

I think it would be better to set the tag to v1.* though, to still get the latest updates. This should probably be in the readme...

JbIPS added a commit to JbIPS/nvim-dap-vscode-js that referenced this issue Jan 11, 2023
Add a tag instruction in Packer installation doc to freeze `vscode-js-debug` version to 1.x and fix mxsdev#23
@tomaskallup
Copy link

tomaskallup commented Jan 24, 2023

Using v1.* also causes this error for me, had to lock it to v1.74.1.

Seems like they released the breaking change as v1.75.

@jessevanassen
Copy link

It should be fixed now and working with the main branch of vscode-js-debug again.

More info: microsoft/vscode-js-debug#1502

@anasrar
Copy link
Author

anasrar commented Jan 31, 2023

It should be fixed now and working with the main branch of vscode-js-debug again.

More info: microsoft/vscode-js-debug#1502

I got everything work, tested on latest commit microsoft/vscode-js-debug@df22101.

should we close this issue ?

@anasrar anasrar closed this as completed Feb 8, 2023
@Raagh
Copy link

Raagh commented Feb 12, 2023

I am still experiencing this on 1.75.1, 1.74.1 works fine though. Really strange, anyone else?

@anasrar
Copy link
Author

anasrar commented Feb 13, 2023

I am still experiencing this on 1.75.1, 1.74.1 works fine though. Really strange, anyone else?

@Raagh use latest commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants