Community
Participate
Working Groups
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.
Hello, Dobrin Could you please attach the project(s) ?
Created attachment 263115 [details] test
Created attachment 263116 [details] node_modules
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.
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
Thank you for the workaround. I'll use it and see if there are other issues with breakpoints.