I initialised an OpenLayers Map, but nothing gets drawn. The map div width and height is set. When I do inspect element, it shown that the canvas element inside the map div has "display: none". Also, none of the images I have in my layers are even loaded. What could be wrong?
I am using OpenLayers 4.
(No code shown because I will answer my own question, posting this for my future self and any others who spent hours fighting with this)