Reputation: 77
Does anyone knows how can i debug puppeteer while it runs headless? I have this E2E Jasmine test which runs fine under non headless mode , but as soon as i run headless , it fails. i'm trying to understand why it fails under headless mode (i'm suspecting it is related to a react render stuff) , but in order to get some common sense , i must use a debugger. P.S the documentation implies i should run non headless in order to see whats going on , but thats not helping in my case :/ Thanks in advance!
Upvotes: 4
Views: 3515
Reputation: 2132
If you need some sort of visual debugging I run an OS project called browserless that has a built-in debugger. It allows you to (essentially) paste in puppeteer scripts and watch/interact with the output in the browser. It's a little nicer than trying to comb through DEBUG logs since it can be pretty noisy.
Upvotes: 0
Reputation: 18826
You can debug it easily with DEBUG
.
Example command to run,
DEBUG=* node app.js
Upvotes: 3