Content
You are here:
Frontend assets return 404 (main.js vs main.xxxxx.js) on server, not locally
Added by Andres Gonzalez over 4 years ago
I'm doing a manual install on a non supported linux server. I have the exact same versions of distro, ruby, node, codebase both on dev/prod -- in development everything works just fine. On production, the front-end does not load properly (blank page), due to the files in assets/frontend/ not being found as they are compiled with hashes (main.xxxxxx.js), and the paths that link to them are not (main.js).
I found the code that writes these assets paths, but I could not figure out where exactly it decides to insert hashes (not familiar w/ rails/angular). Any help would be greatly appreciated -- thank you!
Replies (1)
I have seen several reports of users with "blank pages" after installation, which is due to the same problem. The issue is memory/angular related:
My dev environment has 8GB ram, while prod has 1GB (I actually increased it to 2GB still didn't work). I am well aware of the requirement of 4GB, but this is for a very small team and seems to be working well. Anyway, the solution is the following (which you can find in the links above) -- is to edit your build scripts (in frontend) like so:
Once this is done, you still need to be sure you have a bit over 2GB of available memory -- not necessarily RAM. I solved this issue by creating a fat swap file (and actually reverted back to 1GB). Everything works just fine, I was able to build, and OP runs well. I'm not saying this is optimal setup for everyone, surely 2GB+ of RAM would be better -- but so far it's been running for a few days just fine ;)