This is a very recent error I encountered when running puppeteer on a deployed draft site. I don’t claim this is a Netlify issue, but maybe I can get pointed in the right direction.
Full error text is below:
ERROR! Error: Could not find Chromium (rev. 1108766). This can occur if either 1. you did not perform an installation before running the script (e.g.
npm install
) or 2. your cache path is incorrectly configured (which is: /home/sbx_user1051/.cache/puppeteer). For (2), check out our guide on configuring puppeteer at Configuration | Puppeteer.
and the draft site is:
https://642f3487fd33ef0a93ae06c3--pgnfen3.netlify.app/; go to Import PGN Files (this calls a lambda function, which uses puppeteer to access a web site)
Things I’ve tried:
- set AWS_LAMBDA_JS_RUNTIME to
nodejs18.x
- disabled cache in puppeteer:
await page.setCacheEnabled(false)
- cleared the browser cache
- cleared the build cache:
yarn cache clear --force
- deployed with --skip-functions-cache
Did the cache path become invalid? It used to work with a simple netlify deploy
Here’s the build log:
Netlify Build
────────────────────────────────────────────────────────────────
❯ Version
@netlify/build 29.5.8
❯ Flags
dry: false
offline: false
❯ Current directory
/home/jlowery2663/pgnfen3
❯ Config file
/home/jlowery2663/pgnfen3/netlify.toml
❯ Context
production
1. build.command from netlify.toml
────────────────────────────────────────────────────────────────
$ react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
605.7 kB build/static/js/main.7a5a1832.js
2.55 kB build/static/css/main.56d686b3.css
1.78 kB build/static/js/787.ffec13a5.chunk.js
The bundle size is significantly larger than recommended.
Consider reducing it with code splitting: https://goo.gl/9VhYWB
You can also analyze the project dependencies: https://goo.gl/LeUzfb
The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
You may serve it with a static server:
yarn global add serve
serve -s build
Find out more about deployment here:
https://cra.link/deployment
(build.command completed in 19.8s)
2. Functions bundling
────────────────────────────────────────────────────────────────
Packaging Functions from netlify/functions directory:
- testgql.js
- pgnfen/pgnfen.js
❯ The following Node.js modules use dynamic expressions to include files:
- yargs
- yargs-parser
Because files included with dynamic expressions aren't bundled with your serverless functions by default,
this may result in an error when invoking a function. To resolve this error, you can mark these Node.js
modules as external in the [functions] section of your `netlify.toml` configuration file:
[functions]
external_node_modules = ["yargs", "yargs-parser"]
Visit https://ntl.fyi/dynamic-imports for more information.
(Functions bundling completed in 7.4s)
Netlify Build Complete
────────────────────────────────────────────────────────────────