After many hours of searching I managed to find out the cause of the problem: Sever-Side Rendering. I must have unwittingly enabled SSR while setting up the project. Needless to say, I followed the steps here to get rid of it and now my page loads as expected.