Running a new jHipster Application using Compass and the main CSS file is not loading

How to fix a Newly Created jHipster Application not Loading the Main CSS File 


If you see an error similar to the following upon first startup of a jHipster application you have just created:

Failed to load resource: the server responded with a status of 404 (Not Found) http://127.0.0.1:8080/assets/styles/main.css


Issue loading main.css on jHipster application
jHipster with CSS not loaded


Then you will need to run the grunt task, grunt compass.


Install Compass

You will need to first install Compass, an open-source CSS Authoring Framework before you can run the Grunt task to create the main.css file which is missing.

Using node:

npm install compass

Reference the following link for more info about installing compass using npm


Run Grunt Task


After you install Compass, you will then need to run the grunt task.  In in IntelliJ you can click the grunt task runner at the bottom of your screen or go to Tools -> Open Grunt Console.

Use grunt task runner console to create Main CSS file
Run grunt compass task to create main.css file

Restart your Application


Try refreshing and restarting your application and the styling should now display correctly.

mvn spring-boot:run

Comments

  1. Just ran a new JHipster application using Compass, but ran into an issue—the main CSS file isn’t loading properly. Debugging build paths now, but it's definitely slowing me down. On the bright side, staying focused with my hydration game strong thanks to a Drink LMNT coupon code I found. A quick electrolyte boost keeps me energized while I tackle front-end frustrations. Dev life = code, fix, hydrate, repeat

    ReplyDelete

Post a Comment

Popular posts from this blog

Change Port on a Spring Boot Application when using intelliJ

How to set up a SQL Server 2008 Local Database

New Personal Website