Run Puppeteer in IBM Cloud Functions

117 views Asked by At

I deployed Typescript code to run Puppeteer in IBM Cloud Functions. It seems to be hanging when executing this code await page.goto(path, {timeout: 0})

Without {timeout: 0}, it will throw "TimeoutError: Navigation timeout of 30000 ms exceeded"

I have tried to configure TypeScript to use latest ecma version ("target": "es2018") as suggested here https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

Also tried await page.evaluate(`(async() => { console.log('1'); })()`);

But no luck. Any idea how I can resolve this? Thank you.

1

There are 1 answers

0
user796870 On

After poking around some more, I figured out that it was this line

await page.setJavaScriptEnabled(true);

that is causing it to hang.