We are including font awesome via
$fa-font-path: "#{$asset-path}/../../project/assets/fonts/fontawesome";
@import "fontawesome/fontawesome";
@import "fontawesome/brands";
@import "fontawesome/solid";
In our Shopware 6 SCSS files.
We noticed on some machines (we are building on server), that the generate CSS file contains "\0" null bytes
.fa-certificate:before {
content: "\0";
}
which leads to an output like this:
Shopware uses webpack to build the CSS file from SCSS.
What can be the reason for this additonal \0
?
We saw https://github.com/FortAwesome/Font-Awesome/issues/14660 but adding the
@charset "UTF-8";
at the beginning of the CSS file does not help.
When we copy the built file from one machine to the other, it works. So it does not seem to be a problem on serving the CSS by the server, but during the built process.
EDIT: Digging deeper:
In the fontawesome SCSS there is:
$fa-var-certificate: \f0a3;
...
.#{$fa-css-prefix}-certificate:before { content: fa-content($fa-var-certificate); }
// Convenience function used to set content property
@function fa-content($fa-var) {
@return unquote("\"#{ $fa-var }\"");
}
Unquote is a sass_function
- I don't know where the \0
comes from
EDIT2 We compared the file vendor/shopware/storefront/Resources/app/storefront/package-lock.json
on both machines, and they are both identical - so the same node package should be in use, just a slightly different node version (local: v14.18.2, server: v14.18.1). Still the problem is not reproducible locally.