Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: vue_1.ref is not a function #287

Closed
SergeyNeroda opened this issue Dec 3, 2020 · 4 comments
Closed

Uncaught TypeError: vue_1.ref is not a function #287

SergeyNeroda opened this issue Dec 3, 2020 · 4 comments

Comments

@SergeyNeroda
Copy link

If the library is connected:

import { VueReCaptcha } from "vue-recaptcha-v3";
Vue.use(VueReCaptcha, { siteKey: "your-public-key" });

an error occurs:
vue_1.ref is not a function

@SergeyNeroda
Copy link
Author

Help me)

@SergeyNeroda
Copy link
Author

Object.defineProperty(exports, "__esModule", { value: true });
exports.useReCaptcha = exports.VueReCaptcha = void 0;
var recaptcha_v3_1 = webpack_require(/*! recaptcha-v3 / "./node_modules/recaptcha-v3/dist/ReCaptcha.js");
var vue_1 = webpack_require(/
! vue */ "./node_modules/vue/dist/vue.common.js");
var VueReCaptchaInjectKey = Symbol('VueReCaptchaInjectKey');
var globalConfig = {
loadedWaiters: [],
error: null
};
exports.VueReCaptcha = {
install: function (app, options) {
var isLoaded = vue_1.ref(false);
var instance = vue_1.ref(undefined);
app.config.globalProperties.$recaptchaLoaded = recaptchaLoaded(isLoaded);
initializeReCaptcha(options).then(function (wrapper) {
isLoaded.value = true;
instance.value = wrapper;
app.config.globalProperties.$recaptcha = recaptcha(instance);
app.config.globalProperties.$recaptchaInstance = instance;
globalConfig.loadedWaiters.forEach(function (v) { return v.resolve(true); });
}).catch(function (error) {
globalConfig.error = error;
globalConfig.loadedWaiters.forEach(function (v) { return v.reject(error); });
});
app.provide(VueReCaptchaInjectKey, {
instance: instance,
isLoaded: isLoaded,
executeRecaptcha: recaptcha(instance),
recaptchaLoaded: recaptchaLoaded(isLoaded)
});
}
};

@WipeAir
Copy link
Contributor

WipeAir commented Dec 3, 2020

Looks like you're using Vue 2.*. The latest version of this library is for Vue 3.
See here

@SergeyNeroda
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants