Search code examples
travis-cibrunchuncss

"UnCSS: Configuration missed" on Travis


I'm setting up uncss-brunch with Travis on a test project. brunch build works well locally, but when I push changes, the build on Travis fails. The error line reads:

18 Apr 22:38:59 - error: UnCSS: Configuration missed. 

Any ideas on what may be wrong, or how may I debug this? I've found that the error message is from the uncss-brunch project itself.


Solution

  • The reason it was working locally is because optimizers normally aren't run in development mode. On Travis, however, you are running npm run dist with runs brunch build -p — a build in production env.

    If you were to run brunch build -p locally, it would give the same result as on Travis.

    Now, the actual reason for that happening seems to be that you are missing a configuration for UnCSS.

    If you take a closer look at the file you've linked, you'll see that the error is printed because this.options is null. And this.options is set from config.plugins.uncss — which is seemingly missing from your brunch-confighttps://github.com/arturocastro/quacknote/blob/master/brunch-config.js

    Check out UnCSS's readme on how to configure it.