prerender / prerender

Node server that uses Headless Chrome to render a javascript-rendered page as HTML. To be used in conjunction with prerender middleware.
MIT License
6.4k stars 924 forks source link

Error on running prerender locally #758

Open icyice80 opened 1 year ago

icyice80 commented 1 year ago

Just got the latest, tried to run it on my local:

Windows 10 64bit, Chrome 112

node server.js 2023-04-18T01:49:17.191Z Starting Prerender 2023-04-18T01:49:17.197Z Starting Chrome 2023-04-18T01:49:17.214Z Prerender server accepting requests on port 3000 2023-04-18T01:49:17.235Z Chrome connection closed... restarting Chrome 2023-04-18T01:49:17.236Z Chrome died immediately after restart... stopping Prerender

Did I missing anything here?

mitsiek commented 1 year ago

Set chromeLocation and chromeFlags (path where your chrome binaries are installed).

Example :

const server = prerender({ chromeLocation: '/usr/bin/google-chrome', chromeFlags: [ '--disable-gpu', '--disable-dev-shm-usage' ] });

jdavidhermoso commented 1 year ago

I'm having the same issue Chrome seems to be found, but it just dies.

Debugging the prerender server.js script, this is the error I'm getting:

Error: connect ECONNREFUSED 127.0.0.1:9222
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
  errno: -61,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 9222
}

Some idea of what might be failing?

Thanks!

captainjackrana commented 11 months ago

Running into the same error.. Unable to run it locally with the latest chrome version on Mac M2

pseudovar commented 1 month ago

Did this get resolved? I've tried a few of the fixes, including Chromium, but I'm currently unable to run this (MacOS M3).