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

Nodeclipse unable to locate source code for debugging for any project source files besides the main launch file, for Node v0.11.14..0.12.2, joyent/node#25358 #189

Open
swingfield opened this issue May 1, 2015 · 9 comments

Comments

@swingfield
Copy link
Contributor

I'm not able to get Nodeclipse to debug through any of my source files other than the main source file with which I started the debugged process. Attempting to step through any other project source files brings up a blank editor with "Source not found" message.

It seems that none of the other source files are getting turned into their chromium counterparts over in the the STANDALONE_V8 project.

My environment is as follows:
Nodeclipse version 0.17
Eclipse version Luna 4.4.1 SR1a
Eclipse distribution Java EE IDE for Web Developers
Node.js version 0.12.2

I believe this issue is the same as reported on stackoverflow here: http://stackoverflow.com/questions/29173417/nodeclipse-only-allows-debugging-of-1-js-file-at-a-time

I created a simple project to demonstrate. I have the two files listed below. I launch hello-world-server.js under the debugger. But attempting to step into source2.js results in a new editor window that says "Source not found." Presumably because source2.js.chromium was not created in the STANDALONE_V8 backing project.

hello-world-server.js:

var src2 = require('./source2.js');
var res = src2.source2Function();
console.log(res);

source2.js:

console.log('source2.js loaded.');
exports.source2Function = function() {
    console.log('in source2Function...');
    return "hi from source2";
}

Below is a screen shot after trying to step into src2.source2Function()

image

And below is my STANDALONE_V8 project contents (notice there is no source2.js chromium file here, even though that module has loaded, as evidenced by the console message written to the terminal).

image

Thank you for any help you can give on this issue.

@swingfield
Copy link
Contributor Author

I just noticed that the related issue, referenced in the stackoverflow link, was logged against nodeclipse.org. Linking it here as I think the two issues are the same or related.

Nodeclipse/www.nodeclipse.org#64

@swingfield
Copy link
Contributor Author

This does appear to be a problem with later versions of node.js - in agreement with the comments in issue Nodeclipse/www.nodeclipse.org#64.

I see the problem with Node.js v0.12.2. I reverted to version Node.js v0.10.38, and the problem goes away.

FYI, there is a perhaps-related discussion about debug related changes in Node.js that have affected the node-inspector project, at node-inspector/node-inspector#534. Different issue on the surface, but in both cases reverting back to v0.10.38 seems to fix the problems.

@3y3
Copy link

3y3 commented May 13, 2015

This can be related with nodejs/node-v0.x-archive#25266

@swingfield
Copy link
Contributor Author

I looked into how the Node-Inspector project is working around this issue, and applied a similar fix into my local Nodeclipse. Namely, I have Nodeclipse listening for the "compileError" debug event, and treating it the same way as the "afterCompile" event.

This seems to work. Nodeclipse now, for example, stops on breakpoints in Express route files. Without the workaround, those breakpoints were ignored. Also, with the workaround in place, the backing STANDALONE_V8 project has all the expected chromium counterparts to the javascript source files. Without the workaround, those chromium files are absent (which, I believe, is why the breakpoints are ignored in the corresponding source files).

With patch:
standalone_v8_with_all_chromium_files

Without patch:
standalone_v8_with_missing_chromium_files

The workaround has two changes to the org.chromium.sdk plugin -- org.chromium/sdk/internal/v8native/DebuggerCommand.java and org.chromium/sdk/internal/v8native/DefaultResponseHandler.java.

I could create a pull request if you like. One misgiving about it, however, is that if this does turn out to stem from a node issue, then the need would be temporary.

@paulvi
Copy link
Member

paulvi commented Jul 8, 2015

@swingfield Pull Request would be great. I don't quite understand why this problem is happening, but we can make this as optional function that it is enabled/disabled in Preferences.
After that it will be only question if this should be enabled by default or for some node version etc.

@paulvi
Copy link
Member

paulvi commented Jul 8, 2015

By the way, welcome to use new Enide 2015 for Node.js and plugin development http://www.nodeclipse.org/enide/2015/

@paulvi
Copy link
Member

paulvi commented Jul 8, 2015

@piotrtomiak should be interested too, as said in nodejs/node-v0.x-archive#25358

@paulvi paulvi added this to the 0.18 milestone Jul 8, 2015
@paulvi paulvi added the critical label Jul 8, 2015
paulvi pushed a commit that referenced this issue Jul 13, 2015
Nodeclipse issue #189 - workaround for node issue 25266
@paulvi paulvi changed the title Nodeclipse unable to locate source code for debugging for any project source files besides the main launch file Nodeclipse unable to locate source code for debugging for any project source files besides the main launch file, for Node v0.11.14..0.12.2, joyent/node#25358 Aug 5, 2015
@paulvi
Copy link
Member

paulvi commented Sep 23, 2015

@swingfield Have you tried with and without PR #193 for io.js or Node 4.x ? What is better solution as for now?

@paulvi
Copy link
Member

paulvi commented Sep 23, 2015

I have tried on Steven examples with released 0.17 (without PR #193) and Node v4.1 ,
and could get into source2 OK

I got #196 however

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