Simon Schraeder
Published on

Using Puppeteer on Hetzner ARM machines

Hetzners new ARM VPS offerings are really quite attractive. For just 3.92 euro per month you get 40GB of disk, 4GB of RAM and 2vCPUs. Compared to their x86 offerings you basically get double storage and memory.

So for a recent project involving Puppeteer I decided to give it a spin.

With Node installed I assumed it was just a matter of running

npm i puppeteer

and then using the normal puppeteer code.

But I faced a strange error. Unterminated quoted string?

/root/project/node_modules/@puppeteer/browsers/lib/cjs/launch.js:262
                reject(new Error([
                       ^

Error: Failed to launch the browser process!
/root/.cache/puppeteer/chrome/linux-113.0.5672.63/chrome-linux64/chrome: 4: Syntax error: Unterminated quoted string

It turns out the bundled Chrome is not suitable for the ARM architecture. So I had to install Chrome separately thrugh my package manager, so for Ubuntu

sudo snap install chromium 

and then specify the path to Chromium when launching puppeteer.

 const browser = await puppeteer.launch({
    headless: 'new',
    executablePath: '/snap/bin/chromium'
  })

And now it was working :)