chrome-launcher
chrome-launcher copied to clipboard
if userDataDir === false, connection to chrome fails (chrome is launched)
Hey, I'm experiencing this consistently on Mac machines. Calling launch with the following options:
chromeLauncher.launch({
startingUrl: 'http://google.com',
userDataDir: false,
})
throws the following error:
{ Error: connect ECONNREFUSED 127.0.0.1:50128
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 50128 }
Any way to circumvent this (and still use the default profile)?
userdatadir has to take a string. either you provide a new location, or chrome-launcher will create a tmpdir.
@paulirish - so this section from the docs is outdated?
// (optional) Chrome profile path to use, if set to
falsethen the default profile will be used. // By default, a fresh Chrome profile will be created userDataDir: string | boolean;
whoops, no, that is still correct.
I'm not having an issue with running with userDataDir: false, though. Can you give more info on your machine and a smallish snippet of init code that reproduces the error for you?
@yuvke oops. sorry! i was wrong about that.
@brendankenny Sure thing.
First, let me note that chrome opens the url as expected. The issue is that after a while the error is thrown. I've tested it with the following snippet:
const chromeLauncher = require('chrome-launcher');
return chromeLauncher.launch({
startingUrl: 'http://google.com',
userDataDir: false,
}).catch((err) => {
console.log('caught');
console.log(err);
});
which prints out:
caught
{ Error: connect ECONNREFUSED 127.0.0.1:63618
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 63618 }
I'm running this on: OSX 10.12.6 iTerm2 3.20 node 8.11.4 chrome-launcher 0.10.2
I'm having the same problem, but in windows 10
OS: Windows 10 Pro v.1803 node: 8.11.4 chrome-launcher: 0.10.2.
Here is the log when I launch the launcher:
