hammerhead.js throwing Uncaught DOMException: Failed to construct 'Worker' error on recaptcha call
See original GitHub issueI have been using testcafe for the last four months without any issue. It has been a smooth transition from selenium! But in the last day I’m running into a new issue that I cannot seem to fix. The most irritating part is that the error does not happen on all chrome instances. It seems to only affect the two machines I have to run the test suites. No changes have been made to the machine or version or testcafe - so I’m wondering what else to try.
What is your Test Scenario?
When opening the log in dialog or log in page for our app - a call is made to recaptcha. A subsequent webworker call is made.
What is the Current behavior?
Visiting the log in page or opening the log in dialog in chrome works just fine. When using testcafe, there is a console error for the webworker call: See below for full error.
What is the Expected behavior?
No error and the webworker call is made
What is your web application and your TestCafe test code?
You can see this error by visiting https://migraine.com/member-login/
import { t } from 'testcafe';
fixture`Recaptcha error`
test('Go to login', async t => {
await t.navigateTo('https://migraine.com/member-login');
await t.debug();
})
Your complete test report:
VM818 hammerhead.js:12 Uncaught DOMException: Failed to construct 'Worker': Script at 'https://www.google.com/recaptcha/api2/webworker.js?hl=en&v=NTa-8tBgsAw62CYTJPliVdrV' cannot be accessed from origin 'http://192.168.1.243:53482'.
at new Worker (http://192.168.1.243:53482/hammerhead.js:12:12048)
at b3.<anonymous> (http://192.168.1.243:53482/yKj9vwo6f*vnYx2GOLE!s!utf-8/https://www.gstatic.com/recaptcha/releases/NTa-8tBgsAw62CYTJPliVdrV/recaptcha__en.js:107:362)
at new b3 (http://192.168.1.243:53482/yKj9vwo6f*vnYx2GOLE!s!utf-8/https://www.gstatic.com/recaptcha/releases/NTa-8tBgsAw62CYTJPliVdrV/recaptcha__en.js:408:252)
at Er.<anonymous> (http://192.168.1.243:53482/yKj9vwo6f*vnYx2GOLE!s!utf-8/https://www.gstatic.com/recaptcha/releases/NTa-8tBgsAw62CYTJPliVdrV/recaptcha__en.js:287:235)
at new Er (http://192.168.1.243:53482/yKj9vwo6f*vnYx2GOLE!s!utf-8/https://www.gstatic.com/recaptcha/releases/NTa-8tBgsAw62CYTJPliVdrV/recaptcha__en.js:393:179)
at Object.init (http://192.168.1.243:53482/yKj9vwo6f*vnYx2GOLE!s!utf-8/https://www.gstatic.com/recaptcha/releases/NTa-8tBgsAw62CYTJPliVdrV/recaptcha__en.js:508:2457)
at http://192.168.1.243:53482/yKj9vwo6f*vnYx2GOLE!i/https://www.google.com/recaptcha/api2/anchor?ar=1&k=6LfD7o8UAAAAAGDI5DRhS6Jrvl0hFxmLh7es1GG0&co=aHR0cHM6Ly9taWdyYWluZS5jb206NDQz&hl=en&v=NTa-8tBgsAw62CYTJPliVdrV&size=invisible&cb=vvrbtdopncld:189:29
Worker @ VM818 hammerhead.js:12
(anonymous) @ VM828 recaptcha__en.js:107
b3 @ VM828 recaptcha__en.js:408
(anonymous) @ VM828 recaptcha__en.js:287
Er @ VM828 recaptcha__en.js:393
(anonymous) @ VM828 recaptcha__en.js:508
(anonymous) @ anchor?ar=1&k=6LfD7o8UAAAAAGDI5DRhS6Jrvl0hFxmLh7es1GG0&co=aHR0cHM6Ly9taWdyYWluZS5jb206NDQz&hl=en&v=NTa-8tBgsAw62CYTJPliVdrV&size=invisible&cb=vvrbtdopncld:189
Steps to Reproduce:
- Go to https://migraine.com/member-login via testcafe
Your Environment details:
- testcafe version: 1.8.8
- node.js version: 12.0
- command-line arguments: --skip-js-errors
- browser name and version: Chrome 87
- platform and version: macOS 10.13, 10.12
- other: Not seeing this on macOS 10.15 with the same version of Chrome
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:13 (3 by maintainers)
Top GitHub Comments
@bdwain
Hello,
You are welcome. We released the
testcafe@1.10.2-alpha.2
version that contains these changes. You can use it to check your scenario:npm i testcafe@alpha
.Thanks!! Working great for me