In Magento 2.4, Checkout page I faced error.
TypeError : Unable to process binding "afterRender: function () {return renderReCaptcha() }"
How to solve this error?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityCreate requiejs-config.js file and add this mixin :
app/code/Vendor/Module/view/frontend/requirejs-config.js
var config = {
config: {
mixins: {
'Magento_ReCaptchaFrontendUi/js/reCaptcha' : {
'Vendor_Module/js/reCaptcha-mixin' : true
}
}
}
};
Create reCaptcha-mixin.js file and add below code :
app/code/Vendor/Module/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;
}
});
}
});
Now, Just need to deploy and clean cache.