percy / percy-puppeteer

Visual testing with Puppeteer and Percy
https://percy.io
MIT License
49 stars 16 forks source link

More helpful error logging during script injection #207

Closed Chrissy closed 3 years ago

Chrissy commented 4 years ago

It would be really helpful to have better error logging here:

https://github.com/percy/percy-puppeteer/blob/ace51ad334364de66df3a201c31a804be6f3c782/lib/index.ts#L28-L37

I get the CSP error pretty regularly when setting up stuff with Percyscript, and CSP usually isn't the problem. Right now, I have a setup that works locally but fails in CI, and it would be extremely helpful to know what is actually throwing the error here.

I also got this error earlier in the setup, but again it wasn't a CSP issue. I simply didn't have my Percy token loaded into the env properly. It probably took me 5x as long to debug because of the misleading and unhelpful message.

Robdel12 commented 4 years ago

Looks like we start to address this in the next iteration of the SDK: https://github.com/percy/percy-puppeteer/blob/ww/new-cli/index.js#L66-L96

Chrissy commented 4 years ago

Awesome good to hear! I did eventually solve my issue (It wound up being an incorrect version of node) but some kind of specific error messaging would have helped a ton.

Robdel12 commented 3 years ago

Closing with the release of v2 🎉