I also faced the same issue in my environment, So I created a module and fixed that issue.
Step1: Create registration.php
file.
app/code/VendorName/ReCaptchaFrontendUi/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'VendorName_ReCaptchaFrontendUi',
__DIR__
);
Step2: Create module.xml
app/code/VendorName/ReCaptchaFrontendUi/etc/module.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="VendorName_ReCaptchaFrontendUi" setup_version="1.0.0">
<sequence>
<module name="Magento_ReCaptchaFrontendUi"/>
</sequence>
</module>
</config>
Step3: Create requirejs-config.js
file
app/code/VendorName/ReCaptchaFrontendUi/view/frontend/requirejs-config.js
var config = {
config: {
mixins: {
'Magento_ReCaptchaFrontendUi/js/reCaptcha' : {
'VendorName_ReCaptchaFrontendUi/js/reCaptcha-mixin' : true
}
}
}
};
Step4: Create mixin file reCaptcha-mixin.js
app/code/VendorName/ReCaptchaFrontendUi/view/frontend/web/js/reCaptcha-mixin.js
define(
[
'uiComponent',
'jquery',
'ko',
'underscore',
'Magento_ReCaptchaFrontendUi/js/registry',
'Magento_ReCaptchaFrontendUi/js/reCaptchaScriptLoader',
'Magento_ReCaptchaFrontendUi/js/nonInlineReCaptchaRenderer'
], function (Component, $, ko, _, registry, reCaptchaLoader, nonInlineReCaptchaRenderer) {
'use strict';
return function(Component) {
return Component.extend({
initCaptcha: function () {
if (typeof this.settings === 'undefined') {
return;
}
this._super();
},
getIsInvisibleRecaptcha: function () {
if (typeof this.settings === 'undefined') {
return;
}
return this.settings.invisible;
}
});
}
});
Step 5: Run all the magento command, Issue will be fixed.
Thanks.