question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hammerhead.js throwing Uncaught DOMException: Failed to construct 'Worker' error on recaptcha call

See original GitHub issue

I 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/

Your complete test code (or attach your test files):
 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:

  1. 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Farfurixcommented, Feb 1, 2021

@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.

1reaction
lynnerscommented, Feb 8, 2021

Thanks!! Working great for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught DOMException: Failed to construct 'Worker': Script ...
This is the error that i am getting papaparse.min.js:6 Uncaught DOMException: Failed to construct 'Worker': Script at ...
Read more >
Unable to create memory game – JS errors - WordPress.org
I can create the post and give it a title – but the rest of the interface does not load. The error from...
Read more >
testcafe-hammerhead: Versions - Openbase
... Fix hammerhead.js throwing Uncaught DOMException: Failed to construct 'Worker' error on recaptcha call (#2566) @Farfurix; support the target attribute ...
Read more >
Recaptcha not working in China - Google Groups
The only thing that you need to do is load the script from https://www.recaptcha.net/recaptcha/api.js. Our system will pick the appropriate url to use....
Read more >
SafetyNet reCAPTCHA API - Android Developers
Register a reCAPTCHA key pair · Label: A unique label for your key. · reCAPTCHA type: Select reCAPTCHA v2, then reCAPTCHA Android. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found