Some event listeners were being set up instantly, rather than after the document was fully loaded. This caused them to try to access a canvas before it was ready, spitting out an error. The relevant code is now in the DOMContentLoaded block.