GoogleChromeLabs / carlo

Web rendering surface for Node applications
Apache License 2.0
9.31k stars 309 forks source link

Error running the app #105

Open d4rckh opened 5 years ago

d4rckh commented 5 years ago

I get this error:

(node:28817) UnhandledPromiseRejectionWarning: Error: Could not start the browser or the browser was already running with the given profile.

OS: Linux 4.14 Chrome: Version 69.0.3497.100 (Official Build) (64-bit)

pavelfeldman commented 5 years ago

What do you do? Also, your Chrome browser is behind, stable is at 70 for many weeks already.

d4rckh commented 5 years ago

ohh :joy:

ill be back

johnjbarton commented 5 years ago

I have run the carlo example successfully on a macbook air, but now I am trying to run it on our linux based corp system . (Our nodejs set up is "special" ;-). I also see this error.

The additional issue here is that the carlo window comes up and stays up. So a few attempts later and you have a bunch of zombie windows.

Is there a way to determine which chrome process was launched (so I don't kill all of my other chrome processes)?

johnjbarton commented 5 years ago

Ok at least in my case the problem was that the puppeteer.launch() property userDataDir resolved to a write-protected directory. My workaround was:

const app = await carlo.launch({userDataDir: "/tmp"});

Since the failure mode is very confusing, it may be best if carlo (or better puppeteer) verified that the directory was writable before launching chrome.

johnjbarton commented 5 years ago

Turns out there is another, undocumented, option, localDataDir which is used both as the default for userDataDir and for another purpose. https://github.com/GoogleChromeLabs/carlo/blob/4e8ed7bdfe656f4c2672ab777ab81df777b2b185/lib/carlo.js#L592