You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had mis-typed the name of a function in a function link. When clicking the link to go to the section containing the function link, the section link would become disabled, and the console would error: TypeError: Argument 2 of EventTarget.addEventListener is not an object.
As far as I can tell, the issue is that RegisterLinks() is failing to register the links in the new section, and never visiting the new section at all. So it seems like the error is actually coming from a different section than the one it is.
An error message should point out that the function doesn't exist, and print the name. Maybe it should even make the second section appear, but with the broken link highlighted red or something.
The text was updated successfully, but these errors were encountered:
If you still see RegisterLinks being called then you're behind the main repo, since that's been refactored to ActivateElement now. But with that being said, I suspect the issue is that in ActivateElement, we do this for a function link:
case "data-call-function":
{
element.addEventListener("click", RetrieveFromWindow(element.attributes[i].value, 'function'));
break;
}
Note that if RetrieveFromWindow hands back a null then we're going to try to bind a null function to the "click" event listener, which is probably the root cause of the error.
What happened
I had mis-typed the name of a function in a function link. When clicking the link to go to the section containing the function link, the section link would become disabled, and the console would error:
TypeError: Argument 2 of EventTarget.addEventListener is not an object.
As far as I can tell, the issue is that RegisterLinks() is failing to register the links in the new section, and never visiting the new section at all. So it seems like the error is actually coming from a different section than the one it is.
Steps to reproduce
Expected behavior
An error message should point out that the function doesn't exist, and print the name. Maybe it should even make the second section appear, but with the broken link highlighted red or something.
The text was updated successfully, but these errors were encountered: