stackoverflow-fanatic icon indicating copy to clipboard operation
stackoverflow-fanatic copied to clipboard

triggerUncaughtException(err, true /* fromPromise */);

Open dharambudh1 opened this issue 1 year ago • 4 comments

Fanatic awarded? No
Screenshot saved { path: 'awarded.png' }
User does not have Fanatic badge yet so capture progress
url https://stackoverflow.com/users/5451849/dharam-budh
node:internal/process/promises:342
  triggerUncaughtException(err, true /* fromPromise */);
  ^

page.waitForSelector: Timeout 30000ms exceeded.
Call log:
  - waiting for locator('[data-badge-database-name="Fanatic"]') to be visible

    at /home/runner/work/stackoverflow-fanatic/stackoverflow-fanatic/build/src/index.js:50:20 {
  name: 'TimeoutError'
}

Node.js v20.15.1
Error: Process completed with exit code 1.

Note: I followed the procedure exactly as outlined, but I'm still encountering this error. How can I resolve it? Please help.

dharambudh1 avatar Jul 22 '24 03:07 dharambudh1

Looks like it's failing to capture the progress on the fanatic badge.

Not sure what the exact issue is you'll have to debug it and work out why it's failing for you.

You can also try running it locally. Start by putting playwright in non-headless mode.

Have a look at which page(s) the code is navigating to. How does it look when you're going there manually yourself? Open the inspector, what selectors are available for the badge HTML elements? Is it a fanatic on the screen or is it on some other page?

connorads avatar Jul 22 '24 07:07 connorads

Hi @connorads, thank you for your response. I’m not very familiar with Playwright. The code seems to work fine up until line 62 in the index.ts. However, it starts failing from line 63. Could you help me troubleshoot this issue?

dharambudh1 avatar Jul 23 '24 04:07 dharambudh1

@connorads, it works intermittently—sometimes it succeeds, and other times it fails.

dharambudh1 avatar Jul 23 '24 04:07 dharambudh1

Hey @dharambudh1

No problem if you don't know playwright, you can learn. I learnt a bit about it by building this project.

This is a fun and silly side project, I don't maintain it as such, but I do accept PRs.

You're a developer I assume. I'm sure if you invest a bit of time trying to reproduce and debug the issue you can determine the cause. Once you find the cause you can potentially propose a fix in a PR. Happy to assist once you've made some inroads.

connorads avatar Jul 23 '24 09:07 connorads