GoogleChromeLabs / carlo

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

Using Chrome executable from puppeteer #146

Closed kumarvi closed 4 years ago

kumarvi commented 5 years ago

Hello,

We're trying to use ndb in our environment and facing the below issues:

tracker1 commented 5 years ago

@kumarvi What OS?

kumarvi commented 5 years ago

@tracker1 Linux

pavelfeldman commented 5 years ago

You should be getting the path to chrome from process.env.CHROME_PATH with the highest priority on Linux. Could you debug this a bit and tell me what is happening there?

You can pass --no-sandbox in the options.args in carlo.launch.

kumarvi commented 5 years ago

@pavelfeldman I get the below exception before coming to that code path:

*****/carlo-test> DEBUG=* CHROME_PATH=/****/node_modules/lib/node_modules/puppeteer/.local-chromium/linux-588429/chrome-linux node index.js
  carlo:app Launching Carlo { bgcolor: '#242424',
  channel: [ 'stable', 'canary', 'chromium' ],
  paramsForReuse:
   { cwd: '*****/carlo-test',
     argv:
      [ '/****/node-v10.14.1-linux-x64/bin/node',
        '*****/carlo-test/index.js' ] } } +0ms
(node:46044) UnhandledPromiseRejectionWarning: Error: The environment variable CHROME_PATH must be set to executable of a build of Chromium version 54.0 or later.
    at linux (*****/carlo-test/node_modules/carlo/lib/find_chrome.js:84:11)
    at findChrome (*****/carlo-test/node_modules/carlo/lib/find_chrome.js:218:24)
    at Object.launch (*****/carlo-test/node_modules/carlo/lib/carlo.js:594:42)
    at launch (*****/carlo-test/index.js:6:23)
    at Object.<anonymous> (*****/carlo-test/index.js:21:1)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
(node:46044) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:46044) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
kumarvi commented 5 years ago

@pavelfeldman To add to the above, we don't have any of the chrome executables being checked here in our default PATH.

And, even if I include our global puppeteer installation location to the PATH, I need to update the executables list above to include chrome to get things working

kumarvi commented 4 years ago

We were able to to get this addressed through https://github.com/GoogleChromeLabs/ndb/issues/238