突然,我的应用程序由于此TypeError而停止编译:Recaptcha不是构造函数。
recaptchaConfig() {
this.recaptcha = new Recaptcha(
config.service.recaptcha.client_key,
config.service.recaptcha.secret_key ,
{...config.service.recaptcha.options}
);
}
它工作得很好,现在我不知道是什么造成的。 https://github.com/arya107/AskArya-Node.js-Vue.js/blob/master/Server/app/http/controllers/controller.js
刚试过你的代码,并用:
var Recaptcha = require('express-recaptcha').Recaptcha;
得到了山姆例外,但如果你尝试:
var Recaptcha = require('express-recaptcha').RecaptchaV3;
它有效,试试吧。