Bug 497703 - If I add a breakpoint to a project called "node_modules" the program is not suspended
Summary: If I add a breakpoint to a project called "node_modules" the program is not s...
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ilya Buziuk CLA
QA Contact: Victor Rubezhny CLA
URL:
Whiteboard: RHT
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-11 13:46 EDT by Dobrin Alexiev CLA
Modified: 2016-07-15 10:04 EDT (History)
1 user (show)

See Also:


Attachments
test (1.74 KB, application/x-zip-compressed)
2016-07-14 17:05 EDT, Dobrin Alexiev CLA
no flags Details
node_modules (1.53 KB, application/x-zip-compressed)
2016-07-14 17:06 EDT, Dobrin Alexiev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dobrin Alexiev CLA 2016-07-11 13:46:05 EDT
We use feature in node that we can put out modules in a “node_modules” in a parent folder and it will be properly found: https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders

Node is working properly but if I add a breakpoint in a source file inside “node_modules” the breakpoint does not get hit. 

To reproduce the issue: 

1. Create a JavaScript project “test”. 
2. Add a file “test.js” to the project with content:
  var m1 = require("m1");
  console.log("m1.myFunc = " + m1.myFunc(3)); 
3. Create a JavaScript project called “node_modules”. 
4. Add a folder “m1” to the project “node_modules”.
5. Add a file “index.js” to the folder “m1” with content: 
  module.exports.myFunc = function( i) {
	return i*i;
  }
6. Debug “test.js” as Node – it works. Node is finding property “index.js”. 7. Add a breakpoint to “index.js”. 
8. Debug “test.js” as Node – it runs, but the breakpoint does not suspend the target. 

Is there workaround for this issues?
Most of our projects are relying on the “node_modules” being found in the parent folder. That is making most of our code hard to debug. 

I tested this on Ubuntu 14.04.
Comment 1 Ilya Buziuk CLA 2016-07-14 16:39:50 EDT
Hello, Dobrin
Could you please attach the project(s) ?
Comment 2 Dobrin Alexiev CLA 2016-07-14 17:05:46 EDT
Created attachment 263115 [details]
test
Comment 3 Dobrin Alexiev CLA 2016-07-14 17:06:03 EDT
Created attachment 263116 [details]
node_modules
Comment 4 Dobrin Alexiev CLA 2016-07-14 17:07:48 EDT
You can add these two projects to your workspace. 
It runs, but a breakpoint added in "node_modules/m1/index.js" does not suspend the target.
Comment 5 Ilya Buziuk CLA 2016-07-15 06:40:33 EDT
Ok, I got what the problem is - might be tricky to fix :/
For now you can try the same workaround as for Bug 497685:


- Customize 'Project Explorer' view to make Chromium VS available (Need to remove check from Customize View -> Chromium Virtual File System)

- After starting debugging new chromium test_test.js project will be created 

- if breakpoint would be set in test_test.js project index.js file, debugger should stop there
Comment 6 Dobrin Alexiev CLA 2016-07-15 10:04:24 EDT
Thank you for the workaround. I'll use it and see if there are other issues with breakpoints.