Glitch + Puppeteer

I’m trying to get a basic Puppeteer example working. It seems to be hanging on something. Any ideas? isn’t a valid URL, so the page.goto hangs with err_name_not_resolved. You want I think.

Whoops, good catch. However, still doesn’t work after providing a valid URL.

I started a discussion on the Puppeteer side of things, too:

you can see why it fails in the Logs:

TypeError: path must be absolute or specify root to res.sendFile
    at ServerResponse.sendFile (/rbd/pnpm-volume/2ba2fb12-3226-4fc6-a9ae-a9cf09896d19/node_modules/
    at app.get (/app/server.js:14:14)
    at <anonymous>

Basically, the issue is that when the endpoint fails, you didn’t write a response for the browser, but only in the logs. Try adding this in the catch, after console.log:


This way you can see the error from the preview too :slight_smile:

By the way, to actually fix the error you can write:


instead of


Feel free to remix!/puppeteer-sample

1 Like

Beautiful, much easier than expected. Sorry for the pilot error, I should’ve caught that. Thanks @etamponi & @Gareth