Yeah, you're right. Because my request is not respond 404. It's going slowly and sometimes 504 time out. So what do you suggests me?
Start with the DNS. If it is slow and only breaks sometimes, DNS is the most likely thing and might be just slow enough that sometimes it works barely and sometimes it fails. 504 is server side error unable to respond.
If JS files are trying to be pulled from remote, then DNS has to be used. If DNS is pointing externally, we'd expect the delay. If it works sometimes, that means that there is some sort of fallback that is likely just timing out sometimes.
I had the same problem when I was playing with NodeBB on a $2.5 vps from Vultr (=512MB ram). htop shows me that build process uses all available ram and cpu. Deploying on a decent machine/vps would solve the problem, aternatively, I called build steps one at a time ( eg ./nodebb build languages , ./nodebb build 'client side styles' etc) . Hope this helps.