Level up your skills at DrupalCon Chicago 2026 with focused Summits and immersive, hands-on Trainings led by community experts.
Problem/Motivation
Getting following error when running the functional JS test added in the module.
1x: Not failing JavaScript test for JavaScript errors is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. This test had the following JavaScript errors: TypeError: Cannot set property 'human' of undefined
at Object.attach (https://drupal9.lndo.site/modules/contrib/antibot/js/antibot.js?r54uz8:19:36)
at https://drupal9.lndo.site/core/misc/drupal.js?v=9.3.0:27:24
at Array.forEach (<anonymous>)
at Object.Drupal.attachBehaviors (https://drupal9.lndo.site/core/misc/drupal.js?v=9.3.0:24:34)
at https://drupal9.lndo.site/core/misc/drupal.init.js?v=9.3.0:29:12
at HTMLDocument.listener (https://drupal9.lndo.site/core/misc/drupal.init.js?v=9.3.0:17:7)
TypeError: Cannot set property 'human' of undefined
at Object.attach (https://drupal9.lndo.site/modules/contrib/antibot/js/antibot.js?r54uz8:19:36)
at https://drupal9.lndo.site/core/misc/drupal.js?v=9.3.0:27:24
at Array.forEach (<anonymous>)
at Object.Drupal.attachBehaviors (https://drupal9.lndo.site/core/misc/drupal.js?v=9.3.0:24:34)
at https://drupal9.lndo.site/core/misc/drupal.init.js?v=9.3.0:29:12
at HTMLDocument.listener (https://drupal9.lndo.site/core/misc/drupal.init.js?v=9.3.0:17:7). See https://www.drupal.org/node/3221100
1x in AntibotJavaScriptTest::testJavaScript from Drupal\Tests\antibot\FunctionalJavascript
Steps to reproduce
Run the functional JS test.
Proposed resolution
Work as per suggestions in the https://www.drupal.org/node/3221100.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork antibot-3256736
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
gaurav.kapoor commentedComment #4
gaurav.kapoor commentedThe change which is introduced in the MR, does fix the error which is shown when running tests and all tests pass as well. Not sure, what's causing them to fail here.
Comment #5
daniel korteThis JS error also shows up on the /antibot page itself.
Comment #6
gaurav.kapoor commentedComment #7
joegraduateI think this is actually a duplicate of #3205217: drupalSettings not updated on rendering form in Ajax and could be fixed by the existing patch on that issue (#3205217-4: drupalSettings not updated on rendering form in Ajax).
Comment #8
danrodComment #9
danrodComment #10
danrodI think this can be merged into the 2.0.x branch, need to fix some ESLINT errors.
Comment #11
danrodComment #12
danrodNeeds some review, just in case anyone wants to have a look on this.
Comment #14
danrod