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

errors on unmount on edge 18 #118

Closed
pospichalales opened this issue Feb 2, 2019 · 8 comments
Closed

errors on unmount on edge 18 #118

pospichalales opened this issue Feb 2, 2019 · 8 comments
Labels
bug Something isn't working

Comments

@pospichalales
Copy link

When I am leaving the page with reCAPTCHA displayed, the following errors are logged to console.
Edge 18.

reacaptcha__cs.js
Unable to get property 'create' of undefined or null reference

anchor
'recaptcha' is not defined

SCRIPT5007: SCRIPT5007: Object expected

They do not have negative effect to reCAPTCHA function but are logged to bugsnag every time as they are related to my page.

@pospichalales
Copy link
Author

We probably need to remove Recaptcha scripts added to header when switching to different page (route)

@jsardev
Copy link
Owner

jsardev commented Feb 3, 2019

@pospichalales Are you manually adding ReCAPTCHA scripts to the DOM? If yes, you could use Reaptcha automatic script injection - it cleans it up on component unmount (so it would get removed on route change).

@jsardev jsardev added the bug Something isn't working label Feb 3, 2019
@pospichalales
Copy link
Author

No, just automatically. On the page with form I use import Reaptcha from 'reaptcha'; and <Reaptcha sitekey=.... />

@pospichalales
Copy link
Author

If I change route, I can see script with source https://www.gstatic.com/recaptcha/api2/v1548052318968/recaptcha__cs.js and https://recaptcha.net/recaptcha/api.js?render=explicit&hl=cs still included in head.

@pospichalales
Copy link
Author

I see if I go to page with Recaptcha in Chrome, then switch route and wait some time, this error is logged to console

error

@pospichalales
Copy link
Author

This is probably different error, you can look here how they solved it dozoisch/react-google-recaptcha#120

@jsardev
Copy link
Owner

jsardev commented Feb 3, 2019

@pospichalales This error is already reported in #97 - let's keep it separate.

According to the error reported right here - I don't really know what can be the reason. I'll have to take a look why it's not being cleaned up on unmount. Unfortunately, I don't have time right now - I could look at it in 2-3 months. If it's very important for you, feel free to investigate and propose a PR :)

@jsardev jsardev changed the title Edge 18 - leaving page with ReCAPTCHA generates errors errors on unmount on edge 18 May 19, 2019
@jsardev
Copy link
Owner

jsardev commented Mar 18, 2022

After a bit of investigation, this looks like some incompatibility of the recaptcha script with that specific version of Edge. Certainly not a bug in this library.

@jsardev jsardev closed this as completed Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants