Element explorer doesn't work on Node 8
Bug report
- Node Version:
8.0.0 - Protractor Version:
5.1.2 - Angular Version:
n/a - Browser(s):
Chrome / chromedriver 2.29.0 - Operating System and Version
Mac Sierra 10.12.5 - Your protractor configuration file
n/a
After installing node v8.0.0 and npm v5.0.0, reinstalling protractor globally and running webdriver-manager update, I cannot run protractor --elementExplorer because I receive the following error:
protractor --elementExplorer
(node:76684) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[11:04:10] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[11:04:11] I/protractor -
[11:04:11] I/protractor - ------- Element Explorer -------
[11:04:11] I/protractor - Starting WebDriver debugger in a child process. Element Explorer is still beta, please report issues at github.com/angular/protractor
[11:04:11] I/protractor -
[11:04:11] I/protractor - Type <tab> to see a list of locator strategies.
[11:04:11] I/protractor - Use the `list` helper function to find elements by strategy:
[11:04:11] I/protractor - e.g., list(by.binding('')) gets all bindings.
[11:04:11] I/protractor -
module.js:487
throw err;
^
Error: Cannot find module '_debugger'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/protractor/built/debugger/debuggerCommons.js:1:82)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
If I revert back to node 7.10.0 I don't get this error.
I don't think we are currently testing against node 8 so it makes sense that this may be broken. Thanks for bringing this up!
I'll try to dig into this in the next few days but a PR to fix this would be very welcome!
_debugger and the legacy CLI debugger were removed in Node 8: https://github.com/nodejs/node/commit/90476ac6ee
Any updates on this?
Could we please know what are the plans for Node 8 support? :)
With Node v8 set to enter LTS in October, maybe we could get an update?
https://github.com/nodejs/LTS#lts-schedule1
According to https://nodejs.org/en/docs/guides/debugging-getting-started/#legacy-debugger , the node.js team is migrating users to the new inspect API.
Are there plans from the team to get this working again with either the inspect API or something other approach?
Same error https://github.com/node-inspector/node-inspector/issues/1025#issuecomment-339202842 4 month already
Also https://stackoverflow.com/questions/44662442/node-inspector-not-starting
I've started having a look into this. Here are a bunch of guesses about how updating this might work:
As far as I can tell, the changes need to happen in debuggerCommons.js
Rather than require('_debugger'); it needs to use require('inspector'); (docs here). You can then open the inspector, create a session, connect to it, and then use session.post and the Chrome DevTools Protocol to send the messages to add the breakpoints.
I'll have a crack at a PR when I get some time.
@phenomnomnominal Hey that's great! May I know when you are available for making the PR? Since this functionality is so useful, would be great if it can be created soon. It will speed up our development so much. Thanks!
@phenomnomnominal Hi, we are planing to support node 8.0 recently, what's your current plan of fixing this issue?
Only what I outlined above. I was planning on having a crack at it this evening.
@phenomnomnominal that's great, thanks a lot!
@phenomnomnominal Hi, any updates so far?
I started having a go, but I was having issues with Selenium when trying to run the tests (any tips?). I’m going to have some more time Tuesday night. The new API is quite different, but I don’t foresee any real issues.
ok, thanks a lot. I am supposed to have some time after Monday, maybe I can also look into it after that.
I got... somewhere? Turns out debugging the debugger isn't as straightforward as I'd have hoped. @qiyigg did you have a chance to look at anything?
I will look into it today, thanks!
I’ll have some more time this evening too, we can compare notes later.