This error happens spontaneously (cannot reproduce), and it seems the fetch is occurring before the element is created. I checked and the "fetch" is returning successfully but the plugin_name + "_html_c" element is not in the body. Maybe line 516 should be moved within the ".then" at line 520.
Two minor nitpicks/suggestions
Since plugin_html_element.id is already defined, use that in the getElementById instead of writing out the string again.
Replace var with let/const in the "for" loop (for consistency with modern JS)
Occasionally I get the following error
Uncaught (in promise) TypeError: Cannot set properties of null (setting 'innerHTML')
in the following code block https://github.com/IGS/gEAR/blob/23832009af7b1ef1eb83a646d2c8535631cf603f/www/js/common.v2.js#L514-L522This error happens spontaneously (cannot reproduce), and it seems the fetch is occurring before the element is created. I checked and the "fetch" is returning successfully but the
plugin_name + "_html_c"
element is not in the body. Maybe line 516 should be moved within the ".then" at line 520.Two minor nitpicks/suggestions
plugin_html_element.id
is already defined, use that in the getElementById instead of writing out the string again.var
withlet/const
in the "for" loop (for consistency with modern JS)