Here is a tip without seeing your SCSS code as I have experienced similar things, but...
If you use a variable such as $backgroundcolor in code as an example:
.mysuperclass {
border: 1px solid $backgroundcolor;
}
You must set a default value for the variable such as
$backgroundcolor: #ccc !default;
The default MUST come before the use of the variable.
See here for the example of setting defaults:
https://github.com/dbnschools/moodle-theme_fordson/blob/master/scss/preset/default.scss#L50