apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.62k stars 840 forks source link

NetBeans only supports obsolete node 6 debug protocol #4127

Closed helpmex-001 closed 4 months ago

helpmex-001 commented 2 years ago

Apache NetBeans version

Apache NetBeans 13

What happened

Cannot use debug on node.js project, need some example step by step

How to reproduce

C:\nodejs\node.exe: [DEP0062]: node --debug and node --debug-brk are invalid. Please use node --inspect and node --inspect-brk instead. Message i get on attempt to debug.

Did this work correctly in an earlier version?

No

Operating System

win 10 pro node 12.13.1

JDK

13

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

Forever

Are you willing to submit a pull request?

Yes

Code of Conduct

Yes

helpmex-001 commented 2 years ago

who can do something? please advise.

matthiasblaesing commented 2 years ago

See the referenced PR for an implementation. A test build is available here:

http://doppel-helix.eu/NetBeans-dev-dev-8c9b627ced2efe6149d4df4df5f5e6d4e62181bb-release.zip

It would be good if you could test it.

helpmex-001 commented 2 years ago

done the settings in https://github.com/apache/netbeans/pull/4220 in 2 img we see same problems fail1 fail2

matthiasblaesing commented 2 years ago

Not sure what you want to tell me. What I see is, that yo configured a node in version 12 and then you overrode the default with the wrong protocol.

Since node 6.X the debug protocol is the "Chrome DevTools protocol". "V8 debug protocol" supported ended with the 6 series.

It would help if you would not just throw in some screenshots without context and describe what you did, what you expected and what really happened. Screenshots can help, but without context they are useless.

helpmex-001 commented 2 years ago

you posted to set on V8, my question is simple can we debug nodejs with netbeans, if is posible ...give example hot to set exactly for versions nodejs like 12.

On a sceen you posted i see version 10 nodejs so i am confused

On Tue, Jun 14, 2022 at 10:52 AM Matthias Bläsing @.***> wrote:

Not sure what you want to tell me. What I see is, that yo configured a node in version 12 and then you overrode the default with the wrong protocol.

Since node 6.X the debug protocol is the "Chrome DevTools protocol". "V8 debug protocol" supported ended with the 6 series.

It would help if you would not just throw in some screenshots without context and describe what you did, what you expected and what really happened. Screenshots can help, but without context they are useless.

— Reply to this email directly, view it on GitHub https://github.com/apache/netbeans/issues/4127#issuecomment-1155452800, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN6NPZSVE5P7NMEWVXXZWSLVPC2EHANCNFSM5WH23HFQ . You are receiving this because you authored the thread.Message ID: @.***>

matthiasblaesing commented 2 years ago

I assume, that you mean the second screenshot. That screenshot was only done to show the available protocols.

you posted to set on V8, my question is simple can we debug nodejs with netbeans, if is posible

Yes - I tried it with a simple script. And could inspect variables, single step through the code, set breakpoints and in general do what I'd expect from a debugger.

...give example hot to set exactly for versions nodejs like 12. On a sceen you posted i see version 10 nodejs so i am confused

As written node 6+ is "Chrome DevTools protocol" and this is also true for 12.

helpmex-001 commented 2 years ago

i selected Chrome DevTools protocol booth in tools options...and project options it say please wait fail3-15062022 When i stop de debbuger and try again... Netbeans go in a state where i cannot click on any button , in task manager it do not say "Not reponding" I used your link distribution to try. Also after certain time netbeans window go blank, just a blank rectangle

matthiasblaesing commented 2 years ago

Please show the message log from the NetBeans run (See: https://stackoverflow.com/questions/50462124/netbeans-where-to-find-the-ide-log). Please also get a thread dump from the moment where NetBeans seems to be unresponsive. With a JDK installed you can run:

# Get the PID of the Java process (look for the entry named "Main")
jps
# Get the threaddump
jstack <PID> > stacktrace.txt
helpmex-001 commented 2 years ago

i am very busy few days, i will resume after, sorry...

matthiasblaesing commented 2 years ago

Changing milestone to NB16 - I currently have no personal use case and the reported did not yet test.

neilcsmith-net commented 1 year ago

I'm removing milestone from this issue entirely. @matthiasblaesing please feel free to manage this one as you wish.

ChristoforosKor commented 11 months ago

Hello, I am having the same problem with Netbeans 19 on Centos 9. At my HTML/JS node options there is not any debug protocol to choose. How can I resolve it?

matthiasblaesing commented 11 months ago

@ChristoforosKor what do you want to do? If you want to debug code running in a webbrowser, this is not the right PR. This is about debugging CLI node programms. In theory the Chrome Developer Tools Protocol can be used with Chrome/Chromium, but given lack of interest in this, I did not followup. I don't like Chrome and Firefox seems to have only a very limited implementation of CDT available, that at my time of checking did not include JS debugging.

ChristoforosKor commented 11 months ago

I want to debug a node application.

με εκτίμηση Χριστόφορος Κορυφίδης

κιν./mob. : +30 6932606269 Διεύθυνση: Κώτσου 9, 34100 Χαλκίδα. Address : Kotsou 9, 34100 Chalkida Greece.

On Mon, 2 Oct 2023 at 23:54, Matthias Bläsing @.***> wrote:

@ChristoforosKor https://github.com/ChristoforosKor what do you want to do? If you want to debug code running in a webbrowser, this is not the right PR. This is about debugging CLI node programms. In theory the Chrome Developer Tools Protocol can be used with Chrome/Chromium, but given lack of interest in this, I did not followup. I don't like Chrome and Firefox seems to have only a very limited implementation of CDT available, that at my time of checking did not include JS debugging.

— Reply to this email directly, view it on GitHub https://github.com/apache/netbeans/issues/4127#issuecomment-1743750750, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEXDUJKIYHVXD7MDNJCCQ3X5MSZDAVCNFSM5WH23HF2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZUGM3TKMBXGUYA . You are receiving this because you were mentioned.Message ID: @.***>

ChristoforosKor commented 11 months ago

Hello, Anyone can help? I am using netbeans 19 on a centos 8 pc for development. I cannot start the debugger cause I get the message that I use the old version of debugging tools. I also don't see a way to select a debug protocol on options like those shown at https://github.com/apache/netbeans/issues/4127#issuecomment-1154873407 as seen at the screen shots below.

screenshot_node

screenshot_properties

Any help is appreciated.

matthiasblaesing commented 11 months ago

@ChristoforosKor please give this some time. PR #4220 was bitrotting for more than a year because no further testing happend, I'll not just drop everything just because now the question is raised again. The debug options are not there because #4220 was never finalized.

matthiasblaesing commented 11 months ago

@ChristoforosKor please have a look at PR #4220. I updated it to be based on current master. This should allow you to test whether that would help you. The Checks page offers a testable development build:

matthiasblaesing commented 10 months ago

@ChristoforosKor did this work for you?

ChristoforosKor commented 10 months ago

@matthiasblaesing Hello, I am sorry, I am not able to download from https://github.com/apache/netbeans/suites/17008902928/artifacts/971564310. I get a 404 error (following is the response from wget): wget https://github.com/apache/netbeans/suites/17008902928/artifacts/971564310 --2023-10-15 10:24:54-- https://github.com/apache/netbeans/suites/17008902928/artifacts/971564310 Εύρεση του github.com (github.com)... 140.82.121.4 Connecting to github.com (github.com)|140.82.121.4|:443... συνδέθηκε. Η αίτηση για HTTP στάλθηκε, αναμονή απάντησης... 404 Not Found 2023-10-15 10:25:35 ΣΦΑΛΜΑ 404: Not Found.

Translating the above from greek language to english wget https://github.com/apache/netbeans/suites/17008902928/artifacts/971564310 --2023-10-15 10:24:54-- https://github.com/apache/netbeans/suites/17008902928/artifacts/971564310 Searching github.com (github.com)... 140.82.121.4 Connecting to github.com (github.com)|140.82.121.4|:443... connected. HTTP send, waiting for response... 404 Not Found 2023-10-15 10:25:35 Error 404: Not Found.

matthiasblaesing commented 10 months ago

Don't know what github did to break downloads, but it works from browser. Please try again.

neilcsmith-net commented 10 months ago

As far as I know you need to be signed in to GitHub to download workflow artefacts, so it might be that (although 404 an odd response).

matthiasblaesing commented 10 months ago

@neilcsmith-net you are right. In a private browsing tab I can open the checks results overview page, but the artifact is not accessible. In this case a 404 is indeed wrong and 403 or 401 would be right.

ChristoforosKor commented 10 months ago

Ok, O downloaded ( I was loged in) and I managed to debug with chrome dev tools. Thanks a lot!.

Will this patch be imported in the next version (20)?

matthiasblaesing commented 10 months ago

@ChristoforosKor thank you for the check. No this will not make it for NB20. I'll have to get back into the PR, rereview it and get it into a mergeable state.

ChristoforosKor commented 4 months ago

Hello,

Is this available on 21 release or will it be available on 22 release?

matthiasblaesing commented 4 months ago

@ChristoforosKor thank you for the reminder. I just merged the change to master - if nothing catastrophic happens, the change will be part of NB22.