Comments (8)
There is a window.grecaptcha.ready
which maybe better than using 500 ms delay.
from ember-g-recaptcha.
Ok, i had some free time today to fix this. It was just a race condition. Recaptcha seems to be initializing window.grecaptcha first and then making another call to load the rest of the data. I can try to do a PR if I'm allowed to fix it.
We just need to check if window.grecaptcha.render is set.
renderReCaptcha() {
if (isNone(window.grecaptcha) || isNone(window.grecaptcha.render)) {
later(() => {
this.renderReCaptcha();
}, 500);
from ember-g-recaptcha.
Make sure your application is not loading multiple times 'https://www.google.com/recaptcha/api.js
from ember-g-recaptcha.
I had this problem too at 0.4.0. I think the instructions have changed along the way. You are probably missing the jsUrl in your env file. I think the ?render=explicit is critical now.
I upgraded to 0.8.0 and added the jsUrl.
// ...
gReCaptcha: {
jsUrl: 'https://www.google.com/recaptcha/api.js?render=explicit', // default
siteKey: 'your-recaptcha-site-key'
}
// ...
}```
from ember-g-recaptcha.
Actually, it was working, now it stopped again. I gave up and added the script tag to my head.
<script src="https://www.google.com/recaptcha/api.js?render=explicit" async></script>
from ember-g-recaptcha.
Maybe... I just patched the existing code by adding || isNone(window.grecaptcha.render)
from ember-g-recaptcha.
I'm seeing this as well when rendering with Fastboot (window is not available on node).
from ember-g-recaptcha.
A quick fix for this is in #11 so I can close this - thanks @craig2017 👍
However, a better solution seems to be the one suggested by @cosmosgenius - so I opened #13
from ember-g-recaptcha.
Related Issues (20)
- Notify component on ReCaptcha APIs loaded HOT 1
- Uncaught TypeError: Cannot read property 'defineProperty' of undefined HOT 8
- Use window.grecaptcha.ready instead of 500ms delay HOT 1
- Cannot read property 'defineProperty' of undefined HOT 1
- Allow parent views/components to trigger reCaptcha reset HOT 2
- Set a default value to jsUrl HOT 2
- Document usage of onRender both in Readme and in dummy app HOT 1
- Remove usage of Ember.Logger from dummy app
- DEPRECATION: Use of `merge` has been deprecated. Please use `assign` instead.
- Is this add-on dead? HOT 3
- Upgrade EmberJS and related libraries HOT 1
- Access-Control-Allow-Origin problem HOT 4
- Seemingly arbitrary test failures: "reCAPTCHA placeholder element must be an element or id" HOT 6
- Disable GRecaptcha in e2e tests
- ember-cli-babel update
- Double GRecaptcha in the same page doesn't work HOT 3
- Create a workflow in Github Actions
- Error after upgrading to Ember 4.4.0 HOT 3
- Appending same query param twice in `components/g-recaptcha.js` + unnecessary `&` at the end HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-g-recaptcha.