Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Frontend assets return 404 (main.js vs main.xxxxx.js) on server, not locally

Frontend assets return 404 (main.js vs main.xxxxx.js) on server, not locally

Added by Andres Gonzalez almost 5 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)

RE: Frontend assets return 404 (main.js vs main.xxxxx.js) on server, not locally - Added by Andres Gonzalez almost 5 years ago

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:

  • AOT build fails due to "JavaScript heap out of memory"
  • Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
  • Angular 7/8 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

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:

"build": "node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --prod --named-chunks --source-map"

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 ;)

  • (1 - 1/1)
Loading...