Error could not found chromium

Hi,

It can help to search the community before creating a new post, there’s been plenty of posts on Puppeteer.

Set an env var of PUPPETEER_CACHE_DIR to /opt/render/project/puppeteer

Then create a build script in your repo, e.g. render-build.sh. With something like:

#!/usr/bin/env bash
# exit on errorset -o errexit

npm install
# npm run build # uncomment if required

# Store/pull Puppeteer cache with build cache
if [[ ! -d $PUPPETEER_CACHE_DIR ]]; then 
  echo "...Copying Puppeteer Cache from Build Cache" 
  cp -R $XDG_CACHE_HOME/puppeteer/ $PUPPETEER_CACHE_DIR
else 
  echo "...Storing Puppeteer Cache in Build Cache" 
  cp -R $PUPPETEER_CACHE_DIR $XDG_CACHE_HOME
fi

Update your Build Command to call the build script, e.g. ./render-build.sh

Alan

1 Like