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

Nodejs 8 - Cannot debug JavaScript via Node.JS (Failed to connect to Standalone V8 VM) #77

Open
rajivkanaujia opened this issue Jun 13, 2017 · 7 comments

Comments

@rajivkanaujia
Copy link

rajivkanaujia commented Jun 13, 2017

First issue is that there is some default setting that is still using --debug and --debug-brk
When I run my simple app, it works. When I try to debug, I get an error on Console

(node:4376) [DEP0062] DeprecationWarning: node --debug and node --debug-brk are invalid. Please use node --inspect or node --inspect-brk instead.

The next step was to force --inspect or --inspect-brk via Preference ---> Nodeclipse. This still does not work.

My js file is simple

var http = require("http");
// create a http server that writes hello world
http.createServer(function(request, response) {
	// Send the HTTP header 
	// HTTP Status: 200 : OK
	// Content Type: text/plain
	response.writeHead(200, {
		'Content-Type' : 'text/plain'
	});

	// Send the response body as "Hello World"
	response.end('Hello World\n');
}).listen(8081);

//Console will print the message
console.log('Server running at http://127.0.0.1:8081/');

When I try to debug this as a Node Application, I get following at Eclipse Console

Debugger listening on ws://127.0.0.1:5858/b1bdf38d-c53a-472d-89f8-6819c5e4c8b1 For help see https://nodejs.org/en/docs/inspector

But then V8 fails. I am not sure where I need to make the changes. Below is the error I get.

Nodeclipse/chromedevtools failed to connect to Standalone V8 VM ( Check Help (F1) and Support http://www.nodeclipse.org/#support ) . Info: Timed out waiting for handshake

I am using Node: v8.1.0 and Eclipse Version: Neon.3 Release (4.6.3) Build id: 20170314-1500

Any suggestions?

See - Nodeclipse/nodeclipse#107

Is there a need for V8 Inspector Protocol for Eclipse?

Output from log file

$ /Applications/Eclipse.app/Contents/MacOS/eclipse -consoleLog
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /Users/rajiv/Development/workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.7.0.20160603-1933.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://1083.fwk1529457505:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://1083.fwk1529457505:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
!SESSION 2017-06-13 19:15:28.458 -----------------------------------------------
eclipse.buildId=4.6.3.M20170301-0400
java.version=1.8.0_60
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -consoleLog

!ENTRY org.eclipse.core.net 1 0 2017-06-13 19:15:37.097
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences

!ENTRY org.eclipse.jface 2 0 2017-06-13 19:15:40.031
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2017-06-13 19:15:40.031
!MESSAGE A conflict occurred for ALT+COMMAND+C:
Binding(ALT+COMMAND+C,
	ParameterizedCommand(Command(de.bastiankrol.startexplorer.copyResourcePathToClipboardFromResourceView,Copy Resource Path to Clipboard,
		Copies the path of the resource to the clipboard,
		Category(de.bastiankrol.startexplorer.commands.category,StartExplorer,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@2c914364,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,,system)
Binding(ALT+COMMAND+C,
	ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.modify.method.parameters,Change Method Signature,
		Change method signature includes parameter names and parameter order,
		Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@25c756f0,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,cocoa,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2017-06-13 19:15:40.032
!MESSAGE A conflict occurred for ALT+COMMAND+Q P:
Binding(ALT+COMMAND+Q P,
	ParameterizedCommand(Command(org.eclipse.php.ui.explorer,PHP Script Explorer,
		Shows the Script Explorer,
		Category(org.eclipse.ui.category.views,Views,Commands for opening views,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@66c9aca2,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,cocoa,system)
Binding(ALT+COMMAND+Q P,
	ParameterizedCommand(Command(org.eclipse.ui.views.showView,Show View,
		Shows a particular view,
		Category(org.eclipse.ui.category.views,Views,Commands for opening views,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@18206382,
		[Parameter(org.eclipse.ui.views.showView.viewId,View,null,true), Parameter(org.eclipse.ui.views.showView.secondaryId,Secondary Id,null,true), Parameter(org.eclipse.ui.views.showView.makeFast,As FastView,null,true)],,true),[org.eclipse.core.commands.Parameterization@351c7030]),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.ui.contexts.window,,cocoa,system)

!ENTRY org.eclipse.debug.ui 4 120 2017-06-13 19:15:48.152
!MESSAGE org.eclipse.debug.ui.toggleBreakpointsTargetFactory extension failed to load breakpoint toggle target because the specified id is already registered.  Specified ID is: org.chromium.debug.ui.ChromiumToggleBreakpointTargetFactory

!ENTRY org.eclipse.wst.jsdt.chromium.debug.core 1 0 2017-06-13 19:16:03.499
!MESSAGE SDK:org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection: Shutdown requested
Jun 13, 2017 7:16:03 PM org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection$3 shutdown
INFO: Shutdown requested

!ENTRY org.eclipse.wst.jsdt.chromium.debug.core 1 0 2017-06-13 19:16:06.510
!MESSAGE SDK:org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection: Shutdown requested
Jun 13, 2017 7:16:06 PM org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection$3 shutdown
INFO: Shutdown requested

!ENTRY org.eclipse.wst.jsdt.chromium.debug.core 1 0 2017-06-13 19:16:09.515
!MESSAGE SDK:org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection: Shutdown requested
Jun 13, 2017 7:16:09 PM org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection$3 shutdown
INFO: Shutdown requested

!ENTRY org.eclipse.wst.jsdt.chromium.debug.core 1 0 2017-06-13 19:16:12.524
!MESSAGE SDK:org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection: Shutdown requested
Jun 13, 2017 7:16:12 PM org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection$3 shutdown
INFO: Shutdown requested

!ENTRY org.eclipse.wst.jsdt.chromium.debug.core 1 0 2017-06-13 19:16:15.531
!MESSAGE SDK:org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection: Shutdown requested
Jun 13, 2017 7:16:15 PM org.eclipse.wst.jsdt.chromium.internal.transport.SocketConnection$3 shutdown
INFO: Shutdown requested

!ENTRY org.eclipse.wst.jsdt.chromium.debug.core 4 0 2017-06-13 19:16:15.635
!MESSAGE Failed to connect to Standalone V8 VM
!STACK 0
java.io.IOException: Timed out waiting for handshake
	at org.eclipse.wst.jsdt.chromium.internal.v8native.JavascriptVmImpl.newIOException(JavascriptVmImpl.java:114)
	at org.eclipse.wst.jsdt.chromium.internal.standalonev8.StandaloneVmImpl.attachImpl(StandaloneVmImpl.java:134)
	at org.eclipse.wst.jsdt.chromium.internal.standalonev8.StandaloneVmImpl.attach(StandaloneVmImpl.java:79)
	at org.eclipse.wst.jsdt.chromium.debug.core.model.JavascriptVmEmbedderFactory$4$1.attach(JavascriptVmEmbedderFactory.java:207)
	at org.eclipse.wst.jsdt.chromium.debug.core.model.DebugTargetImpl.attach(DebugTargetImpl.java:74)
	at org.eclipse.wst.jsdt.js.node.internal.launch.NodeDebugConnector.attach(NodeDebugConnector.java:118)
	at org.eclipse.wst.jsdt.js.node.internal.launch.NodeLaunchConfigurationDelegate$DebuggerConnectRunnable.run(NodeLaunchConfigurationDelegate.java:179)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.TimeoutException
	at java.util.concurrent.FutureTask.get(FutureTask.java:205)
	at org.eclipse.wst.jsdt.chromium.internal.standalonev8.StandaloneVmImpl.attachImpl(StandaloneVmImpl.java:127)
	... 6 more

How is my project build?

image

@ghost
Copy link

ghost commented Jan 2, 2018

I am having this same issue. How to correct this?

@rajivkanaujia
Copy link
Author

No fix available. I moved to Visual Studio Code.

@luki2678511
Copy link

luki2678511 commented Jan 8, 2018

i got the same issue too, i guess downgrade nodejs 8 to nodejs 6 may be work

@luki2678511
Copy link

it's work, downgrade to nodejs v6.12.3 solve

@paulvi
Copy link
Member

paulvi commented Jan 11, 2018

OK, so it is issue for Nodejs 8+

@paulvi paulvi changed the title Cannot debug JavaScript via Node.JS (Failed to connect to Standalone V8 VM) Nodejs 8 - Cannot debug JavaScript via Node.JS (Failed to connect to Standalone V8 VM) Jan 11, 2018
@paulvi
Copy link
Member

paulvi commented Jan 11, 2018

@rajivkanaujia This repository is sources for web site. The main Nodeclipse plugins source are at https://github.com/nodeclipse/nodeclipse-1/

@paulvi
Copy link
Member

paulvi commented Jan 11, 2018

For this issue please follow Nodeclipse/nodeclipse#220

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

3 participants