Backoffice/admin CSS Smidge/NUglify error, breaking package styling

When Umbraco admin/backoffice loads, it loads this CSS:

/sb/umbraco-backoffice-css.css.v637823303400000000

However, this URL returns a 500 because of the following error:

System.InvalidOperationException: Expected expression, found ‘’,Expected expression, found ‘’
at Smidge.Nuglify.NuglifyCss.ProcessAsync(…)

at Smidge.FileProcessors.CssImportProcessor.ProcessAsync

In the development environment Smidge/NUglify doesn’t seem to run, so we get one CSS for each package, and of all these work.

So it seems the backoffice/admin Smidge/NUglify is broken because something in the installation, or a package, makes Smidge/NUglify try to import an empty file, or something similar.

Clearing the App_Plugins folder and re-installing and re-deploying all packages does not help.

As a workaround, is there a way to turn off backoffice/admin Smidge/NUglify to get the same behavior as in development? Removing the RuntimeMinification block from AppSettings doesn’t seem to make a difference.

Any other ideas what could be breaking this?

The packages that load CSS files are:

  • Diplo GodMode
  • Translation Manager
  • Translation Manager Languagewire Connector
  • Umbraco Forms
  • uSync

Removing each package one by one and testing is a bit tedious because it works in development. And when clearing the App_Plugins folder in production Umbraco still tries to load CSS/JS from those folders, so Smidge/NUglify breaks anyway. Not sure how Umbraco “remembers” what to load.

EDIT: SimpleRedirects is missing from the package list above, and it seems to be causing the problem (see below).


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/108469-backofficeadmin-css-smidgenuglify-error-breaking-package-styling

Throwing my experience in here because I’ve had this issue in v13.8.0 today:

This post originated from a post on the old forums, which provides more detail: backofficeadmin css smidgenuglify error breaking package styling

Another post from the old discord chats is here: Smidge fails to find files Umbraco #help-with-umbraco

Another one for good luck: Missing Backoffice CSS Files for Forms - v13.8.0 and Forms v13.4.1 - #9 by BradleyCSO

(I can’t reply to any of the above posts, so hopefully any searcher finds this)

The long and short of this is: one of the App_Plugins css is failing due to it being invalid. In my case, I had added a plugin myself for a custom field, where the css file was literally

body {
}

And that broke smidge. Once I removed the reference to that file in my package.manifest, it worked fine.

I was able to test this faster by Sebastiaan’s suggestion of publishing to disk and running
dotnet MyProject.dll --urls "https://*:5001" , which saved me publishing everything to check.

I hope this helps someone.

Another possibly undocumented feature, is that if you add a *.min.(js|css) into the smidge bundle, smidge knows not to try and nuglify it, so simply includes in the bundle without trying to minify/compress so if your css was causing nuglify issues it now won’t. (though you should probably find out what’s causing the failure)

Yes, for usync we use the Bundle option in the package. Manifest, by setting this to none, it doesn’t get bundled up and hence isn’t reliant on the single css/js file in production actually working.

as long as you a) don’t care about minification or b) do the minification yourself, this means your bundle can avoid going through smidge.