4

I am using: https://www.npmjs.com/package/puppeteer-pdf which has puppeteer as a dependency.

Heroku is angry about my >500mb slug size, so I am trying to reduce it.

It looks like if I can setup puppeteer to use headless_shell instead of the full chromium download, then I can greatly reduce size of my npm modules.

However I am struggling to get it installed and working with headless_shell:

mkdir headless && cd headless
npm init -y
touch .npmrc
echo "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true" > .npmrc
npm i puppeteer

Then I run node and try to launch puppeteer:

const puppeteer = require('puppeteer');
puppeteer.launch({executablePath: 'out/Release/headless_shell'});

Uncaught:
Error: Failed to launch the browser process! spawn out/Release/headless_shell ENOENT


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/Users/me/delete/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:194:20)

If anyone knows how to get setup with headless_shell that would be great.

JMurphyWeb
  • 382
  • 1
  • 11

0 Answers0