music-encoding / guidelines

:scroll: The Music Encoding Initiative Guidelines
Educational Community License v2.0
23 stars 29 forks source link

Javascript error when displaying full description of attributes #200

Closed craigsapp closed 3 years ago

craigsapp commented 3 years ago

On documentation webpages such as:

https://music-encoding.org/guidelines/v4/elements/artic.html#attributes

There is a javascript error occurring when the page is loaded:

Screen Shot 2021-10-19 at 6 24 30 PM

Function where the problem occurs:

Screen Shot 2021-10-19 at 6 24 17 PM

The problem is that newTab is being set to null and then trying to access .classList on null is causing the crash. This results in the tabs not being prepared, and then access to the contents of the tabs becomes unavailable (such as the full definition tab for attributes on this page:

Screen Shot 2021-10-19 at 6 31 21 PM
musicEnfanthen commented 3 years ago

Related to https://github.com/music-encoding/music-encoding/issues/823 which should have been fixed (hopefully).

Can you try to delete your cached LocalStorage entries for https://music-encodig.org ?

craigsapp commented 3 years ago

Thanks! It is working again:

Screen Shot 2021-10-20 at 6 04 05 AM
craigsapp commented 3 years ago

Can you try to delete your cached LocalStorage entries for https://music-encodig.org ?

On another computer, the problem was related to a cookie rather than localStorage. (maybe cookies were previously used for storing the view preferences of the attributes tab?). The cookie seems to have been moved to localStorage, since I do not see it reappear when reloading after removing the cookie.

Issue https://github.com/music-encoding/guidelines/issues/197 was probably related to this one as well.

It would be wise to check if newTab is null before trying to use it 😉

kepper commented 3 years ago

this is coming up irregularly – we should investigate, but it doesn't seem to be a simple problem or fix…