Application styling/css not working when moved to Render

Hello all. I’ve recently switched to Render for personal projects with the intention of moving our work Production application from Heroku to Render once I get Render all figured out.

The issue I’m having is that my CSS file is not loading, no styles are coming into the application. I use webpacker for stylesheets and javascript. The assets load up fine in Heroku, they load up fine in local development. It seems to be packed properly, everything else on the site loads fine including javascript.

However, I don’t understand why Render is unable to find the CSS file. I have one CSS file that all my Views depend on and it is in javascript/stylesheets/application.scss.

application.js

import Rails from "@rails/ujs"
import Turbolinks from "turbolinks"
import * as ActiveStorage from "@rails/activestorage"
import "channels"
import "bootstrap"
import "../stylesheets/application.scss"
Rails.start()
Turbolinks.start()
ActiveStorage.start()

application.scss

.page-content {
  flex: 1 0 auto;
  background-color: lightgrey;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.search-area {
  padding-top: 50px;
}

.no-right-padding {
  padding-right: 0 !important;
}

.no-left-padding {
  padding-left: 0 !important;
}

.results-block {
  display: inline-block; 
}


.jumbo-bg {
  background-image: url("image-bg4.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.nav-link {
  color: white !important;
}

.navbar-brand {
  font-size: 1em;
}

.admin-color {
  color: #FF3333
}

.mod-color {
  color: #008000
}

.owner-color {
  color: #ff9900
}

#logo {
  float: left;
  font-size: 1.0cm;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: -1px;
  font-weight: bold;
}

#footer {
  background-color: rgb(42, 42, 42);
}

html,
body {
  height: 100%;
}

a:link { text-decoration: none; }

I’ve followed the Ruby on Rails guide on the site…but the example Render app it’s using doesn’t use any styling so I wasn’t able to see how it should work. I have a pretty basic app I just started building but I cannot get any styling to work when I get the application into Render.

Hopefully someone here is using Render for Ruby/Rails and can point me in the right direction.

Hi,

This sounds more like a build config issue (e.g. asset:precompile) rather than a code issue, if the assets work in other environments.

Please could you share some specific details of the issue you are experiencing that may help us troubleshoot it with you, e.g. Build/Start Commands, any logs/errors/output, specific URLs, service name/ID, reproduction steps, etc. If you don’t want to share these details on the community forum, please feel free to raise a ticket from the “Contact Support” link at the bottom of the Dashboard.

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.