I am trying to execute below code,but it throws Unhandled promise rejection warning in the pipelines. Locally it works fine without any issue.
Logs
ERROR: The process "3224" not found.
(node:836) UnhandledPromiseRejectionWarning: #
(node:836) 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)
(node:836) [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.
Following is the JS code:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
//defaultViewport: null,
headless:false,
slowMo: 500,
timeout: 10000
//slowMo: 500,
//devtools: true,
});
const page = await browser.newPage();
await page.goto('https://www.google.com', {waitUntil: 'networkidle2'});
await page.waitFor(10000);
await browser.close();
})();