TypeError:Recaptcha不是构造函数

问题描述 投票:1回答:1

突然,我的应用程序由于此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

javascript node.js express recaptcha
1个回答
3
投票

刚试过你的代码,并用:

var Recaptcha = require('express-recaptcha').Recaptcha;

得到了山姆例外,但如果你尝试:

var Recaptcha = require('express-recaptcha').RecaptchaV3;

它有效,试试吧。

© www.soinside.com 2019 - 2024. All rights reserved.