I’ve been trying to deploy my node app which makes use of puppeteer to scrape a website. Although the build and deployment is successful, I end up getting the following error when I start the service.
May 25 01:33:33 PM (node:62) UnhandledPromiseRejectionWarning: Error: Could not find Chromium (rev. 1095492). This can occur if either May 25 01:33:33 PM 1. you did not perform an installation before running the script (e.g. `npm install`) or May 25 01:33:33 PM 2. your cache path is incorrectly configured (which is: /opt/render/.cache/puppeteer). May 25 01:33:33 PM For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration. May 25 01:33:33 PM at ChromeLauncher.resolveExecutablePath (/opt/render/project/src/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:127:27) May 25 01:33:33 PM at ChromeLauncher.executablePath (/opt/render/project/src/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:206:25) May 25 01:33:33 PM at ChromeLauncher.launch (/opt/render/project/src/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:93:37) May 25 01:33:33 PM at async scrapeReddit (/opt/render/project/src/redditScraper.js:5:21) May 25 01:33:33 PM at async /opt/render/project/src/server.js:16:21 May 25 01:33:33 PM (Use `node --trace-warnings ...` to show where the warning was created) May 25 01:33:33 PM (node:62) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) May 25 01:33:33 PM (node:62) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.