CSS in Production


#1

Soo…
i switched one of my project to production… the application bakery stuff runs through… but in the frontend the css is missing…

to be precise the css i made in my sprinkles is missing… what did i do wrong?


#2

Could be a path issue, since it changes between development and production builds. Make sure your referencing assets as described at https://learn.userfrosting.com/asset-management/basic-usage#referencing-assets

If that doesn’t fix things, let us know (and let us know what version of UserFrosting your working with).


#3

ok, i’m using

{% extends “pages/abstract/default.html.twig” %}

{% block stylesheets_page_group %}
{{ assets.css(‘css/pages/base’) | raw}}
{% endblock %}

to add my css to the default twig

the other css is working and linking fine just this isn’t

i’m turning my

‘assets’ => [
‘use_raw’ => true
]

for now for the production but this shouldn’t be it

ah uf version: 4.1.22


#4

Yeah, use_raw isn’t best for efficiency since UF ends up acting as a file server for all assets.

Given that this is working under a development environment, I’m guessing that you have defined the bundle. The next steps would be to check what is being generated by assets.css('css/pages/base') in production to ensure there is a valid URL for the asset (and something is being generated at all), check that the asset exists on the server’s public folder, and to check for request failures in the browser dev tools (F12, network tab).


#5

Yeah the referenced css file for the css coming from my site-sprinkle is not there.
but i have no clue why it is not generated at all…
not on my live server and even not on my development server when i try it out there.

Edit says: and no error message that i found … where should i find an error message from the build-assets?


#6

Might be worth heading over to chat.userfrosting.com/channel/support at this point. If you are lucky timezones will align and you’ll be able to have a real-time chat with someone.


#7

thx will try when i’m at home getting hands on my development environment, probably monday…
but since i’m from germany that may be a hard