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: this.getRecaptcha is not a function #30

Closed
Ephasme opened this issue Jan 15, 2017 · 17 comments
Closed

Uncaught TypeError: this.getRecaptcha is not a function #30

Ephasme opened this issue Jan 15, 2017 · 17 comments

Comments

@Ephasme
Copy link

Ephasme commented Jan 15, 2017

I carefully followed your steps for installation but I keep getting this error.
I have done nothing special. Inserted the tag in the head, added VueRecaptcha as a component and put the key in the key attribute.

What do you need from me in order to debug this?

@DanSnow
Copy link
Owner

DanSnow commented Jan 16, 2017

Can you provide a jsbin or jsfiddle to reproduce it?
Or a gist if you are using vue-recaptcha from npm.
Thanks.

@DanSnow
Copy link
Owner

DanSnow commented Jan 16, 2017

I have tried some possible ways, but I can't reproduce this error.
By the way, I noticed that my document is outdated. Prop key have been renamed to sitekey.

@DotCoyote
Copy link

Got the same error...

@Ephasme
Copy link
Author

Ephasme commented Jan 20, 2017

I'll give you a gist asap

@hybaken
Copy link

hybaken commented Jan 20, 2017

Got the same problem with version 0.3.0.
v0.2.1 works ok

@DanSnow
Copy link
Owner

DanSnow commented Jan 31, 2017

@Ephasme @CinKon @hybaken
Hello, I really need someone help me to reproduce this.
Or I can't fix it.

@jzelez
Copy link

jzelez commented Feb 4, 2017

There appears to be a problem with the npm version of the package.
When installing directly from github (yarn add github:DanSnow/vue-recaptcha), it works just fine. Except you have to import like import VueRecaptcha from 'vue-recaptcha/dist/vue-recaptcha'.

@DanSnow
Copy link
Owner

DanSnow commented Feb 4, 2017

@jzelez
Got it. Thanks.
But I still can't get this error.

I think I can just change the main script in package.json to dist/vue-recaptcha.js.

@jzelez
Copy link

jzelez commented Feb 4, 2017

I've tested it some more. It isn't an issue with npm or anything... Sorry for false alarm.
The problem is definitely package.json pointing to a wrong file. Fix that, publish new version and all is good in the world. ;)

@DanSnow
Copy link
Owner

DanSnow commented Feb 4, 2017

OK. I've published v0.3.1.

@DanSnow DanSnow closed this as completed Feb 4, 2017
@jzelez
Copy link

jzelez commented Feb 4, 2017

There is now a problem when installing:

❯ yarn add vue-recaptcha
yarn add v0.18.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/vue-recaptcha/-/vue-recaptcha-0.3.1.tgz: invalid tar file".


❯ npm install vue-recaptcha
npm ERR! cb() never called!

@DanSnow
Copy link
Owner

DanSnow commented Feb 4, 2017

Oh. Maybe I shouldn't use yarn to publish it.

@DanSnow
Copy link
Owner

DanSnow commented Feb 4, 2017

I don't know why the tarball on npm is corrupt.
I publish it again with version 0.3.2.
And I have tested it. It should work.

@jzelez
Copy link

jzelez commented Feb 4, 2017

Hmm.. now it installs, but gives the previous error Uncaught TypeError: this.getRecaptcha is not a function when using import VueRecaptcha from 'vue-recaptcha'.
If I changed it back to your compiled version (import VueRecaptcha from 'vue-recaptcha/dist/vue-recaptcha') then it works.

Package.json now points to main.js, which apparently doesn't compile as it should. I think you should point main to dist/vue-recaptcha.js.

@DanSnow
Copy link
Owner

DanSnow commented Feb 4, 2017

But I have change the entry point to `dist/vue-recaptcha.js
Here is package.json on unpkg.
Can you check which version you installed?

@DanSnow DanSnow reopened this Feb 4, 2017
@jzelez
Copy link

jzelez commented Feb 4, 2017

Yup. It works now.. Seems yarn messed up my local cache. Sorry about that :)

Thanks! 👍

@DanSnow
Copy link
Owner

DanSnow commented Feb 5, 2017

OK. I'll close this issue.

@DanSnow DanSnow closed this as completed Feb 5, 2017
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

5 participants