Skip to content

Debug via extension broken with VSCode 1.20 #158

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

Closed
andreaboriani opened this issue Feb 9, 2018 · 20 comments
Closed

Debug via extension broken with VSCode 1.20 #158

andreaboriani opened this issue Feb 9, 2018 · 20 comments

Comments

@andreaboriani
Copy link

Cannot run "Launch on android" nor "Attach on Android" after updating Visual Studio Code to version 1.2ù
Any workaround?

@NickIliev NickIliev changed the title Extension broken on Windows 10 with vscode 1.2 Debug via extension broken with VSCode 1.20 Feb 13, 2018
@cfirmo33
Copy link

waiting for this correction too.

@EddyVerbruggen
Copy link
Member

Wondering if this is Windows-only.

Does anyone see this on macOS? I'm running VSCode 1.2 on macOS and extension version 0.7.2 and can attach/launch on Android just fine.

@NickIliev
Copy link

@EddyVerbruggen I've experienced this one on macOS as well.
However, the issue is not consistent on Mac while on Windows it is 100% reproducible

@EddyVerbruggen
Copy link
Member

EddyVerbruggen commented Feb 14, 2018

Hmm, macOS is rock solid for me (and I don't currently have a Windows machine at hand). For anyone experiencing this issue: I wonder if it would help if you change this in launch.json:

        {
            "name": "Launch on Android",
            "type": "nativescript",
            "request": "launch",
            "platform": "android",
            "appRoot": "${workspaceRoot}",
            "sourceMaps": true,
            "watch": true,
        },

to

        {
            "name": "Launch on Android",
            "tnsArgs": [
                "--debug-brk"
            ],
            "type": "nativescript",
            "request": "launch",
            "platform": "android",
            "appRoot": "${workspaceRoot}",
            "sourceMaps": true,
            "watch": true,
        },

so add that tnsArgs bit.

And if that works (the debugger should stop at the first NativeScript line that's executed), then please also test --debug instead of --debug-brk.

@tedekeroth
Copy link

Hey,
running win7, Vscode 1.20.1. Tried both --debug-brk and --debug, no change for me at least.

@andreaboriani
Copy link
Author

andreaboriani commented Feb 15, 2018

Just to clarify, the problem is not debugging.
When you click 'Launch on Android' nothing happens. The debug console window remains empty, with no [NSDebugAdapter] nor [NativeScriptCli] shown.

@EddyVerbruggen
Copy link
Member

Thanks for the feedback! Knowing that adding --debug(-brk) didn't help made me install a virtual Windows machine on my Mac to reproduce this issue myself.

After some fooling around in the codebase and trying to wrap my head around how the debugger server and client communicate (sockets, in this case) I found the issue and a solution... so expect a PR real soon.

@EddyVerbruggen
Copy link
Member

⬆️ PR pending 🎉

@thaoula
Copy link

thaoula commented Feb 21, 2018

That is great news!!! When can we expect the PR to merged?

Currently debugging with the Chrome Dev tools is not an awesome experience.

@thaoula
Copy link

thaoula commented Feb 24, 2018

When will a new version of the Nativescript extension with theses fixes be pushed out?

@etabakov
Copy link
Contributor

We are aiming to release it early next week. Meanwhile, you can try the latest bits by building the extensions from the latest master branch. There were already tested and no issues were found.

@EddyVerbruggen
Copy link
Member

Cool! Thanks for merging this @etabakov 👍

@etabakov
Copy link
Contributor

We thank you for the help with this issue 💯

@etabakov
Copy link
Contributor

A new version was just published. Let us know how it goes!

@thaoula
Copy link

thaoula commented Mar 2, 2018

Hi @etabakov,

So I can now debug and vscode does not hang. However, quite frequently the process will timeout and debugging does not work.

I have also noticed node-sass is left running in the background, one for each time i try and use the debug function in vscode.

if I dont kills the node-sass process it will cause loop through transferring the files to the similator several times before you see broken app (css broken) and the following error in the console.

Error: Css styling failed: Error: undefined:1:16: missing '{'

I am running on Mac OS High Sierra and mainly trying to connect to IOS.

Regards,
Tarek

@etabakov
Copy link
Contributor

etabakov commented Mar 2, 2018

Hey Tarek,

I believe these are separate issues that are not relevant to the problem that we solved in this issue. Can you open a separate issue and we will try to look at it? Also, I think there is a very similar issue reported already in a separate thread: NativeScript/nativescript-cli#3235

Thanks,
Emil

@thaoula
Copy link

thaoula commented Mar 2, 2018

Hi Emil,

I was also having a problem debugging with VS code up until this patch. Try to debug did nothing or hung vscode.

I will check out the issue you mentioned.

On a side note, are there any plans to create a mono repository for Nativescript so all toolchain issues and code are in a single repository?

Regards,
Tarek

@thaoula
Copy link

thaoula commented Mar 2, 2018

Hi @etabakov,

The last post on the issue use suggested was from me... can someone assist?

Regards,
Tarek

@etabakov
Copy link
Contributor

etabakov commented Mar 2, 2018

We are currently working on a Release Candidate for 4.0 and the team is focused entirely on this task. After that we will probably be able to take a look at the issue and get back to you.

@thaoula
Copy link

thaoula commented Mar 2, 2018 via email

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

No branches or pull requests

7 participants