-
Notifications
You must be signed in to change notification settings - Fork 443
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
fix: solve error with anchor without href #523
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
cb15f00
to
b2b58a1
Compare
Hello catch ($I) {
a.s.onFailure()
} The error , on our case, is:
So, digging a bit deeper we detected the issue was coming from this part of the gtag.js script: Hn = function(a) {
var b = E.createElement("a");
a && (b.href = a);
var c = b.pathname;
"/" !== c[0] && (a || Ab("TAGGING", 1),
c = "/" + c);
var d = b.hostname.replace(An, "");
return {
href: b.href,
protocol: b.protocol,
host: b.host,
hostname: d,
pathname: c,
search: b.search,
hash: b.hash,
port: b.port
} So would be great to have this MR merged the sooner the better ! |
Thanks @franpeza for this PR |
@SirJalias did you figure out why gtag is adding an empty anchor ? |
We tried to debug the code but it was so difficult to follow the execution since it's minified, so we are not sure actually 🥲 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your amazing help @franpeza
hello @gioboa and thanks for merging this PR. Do you have an estimate of when there will be a new version that includes these changes? Thanks :) |
by the way, and after digging into the open issues, this should solve #189 too |
What is it?
Description
An error is thrown when trying to access a property of an anchor element that hasn't been set an href. This PR fixes this issue handling the scenario and returning an appropriate value depending on the property accessed.
This is how the error looks like:
Checklist: