Closed igalklebanov closed 1 year ago
Also running into this on https://github.com/transitive-bullshit/chatgpt-api
I ended up switching captcha providers because it wouldn't work when invoked via tsx
(which uses esbuild
under the hood).
I think I tried tsx
too, but either it didn't work because of this issue or something with decorators. So went with ts-node
because well, build is not as slow as waiting for hcaptcha provider's response.
@igalklebanov great find 👍
I'll try to merge this in before merging #763, for attribution :)
Successfully published:
- puppeteer-extra-plugin-recaptcha@3.6.8
This one was a real pain in the *@#^@. But now the sun can shine once again, and the scraping can continue!
Basically, was having a blast running
plugin-recaptcha
locally withts-node
, and once the same code hit production aws lambdas it started throwing the mentioned error.Long story short, it was
esbuild
and the way it transformedRecaptchaContentScript
&HcaptchaContentScript
classes into something likevar HcaptchaContentScript = class {
.The fix looks for such a sequence and injects the class name back.