"yarn build:production" missing assets, but "yarn build" works?

When I built for production, most of my custom SCSS styles were gone and all of my images in the assets/images folder didn’t make it to dist, but when I only do “yarn build”, it works fine. Any ideas? Thanks!

Did you find a solution?
I have exactly the same problem…
Thank you!

ok it was the problem with Bootstrap 4 CSS:

The solution is adding these lines:

$navbar-dark-toggler-icon-bg: none;
$navbar-light-toggler-icon-bg: none;

to:
resources/assets/styles/common/_variables.scss

3 Likes

Thank you @fint for this.
It helped my save some hair.

I would like to bump this up because this is still a problem.

I ALMOST submitted another thread because I could not get build:production to work properly. If anyone is having problems getting their style sheet to load after running build production then this is the fix you need to apply. YOU will likely lose hair over this one otherwise.

1 Like

I’m having a very strange issue with the very same symptoms as the bootstrap scss yarn build:production bug.

only its not this bug. it only looks the same.

in main.scss I have @import "common/font";

in common/_font.scss I have linked a font like this:

// SOURCE SANS PRO
// this css-code was created via https://google-webfonts-helper.herokuapp.com/

/* stylelint-disable */
/* open-sans-300 - latin */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/open-sans-v17-latin-300.eot'); /* IE9 Compat Modes */
  src: local('Open Sans Light'), local('OpenSans-Light'),
       url('../fonts/open-sans-v17-latin-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('../fonts/open-sans-v17-latin-300.woff2') format('woff2'), /* Super Modern Browsers */
       url('../fonts/open-sans-v17-latin-300.woff') format('woff'), /* Modern Browsers */
       url('../fonts/open-sans-v17-latin-300.ttf') format('truetype'), /* Safari, Android, iOS */
       url('../fonts/open-sans-v17-latin-300.svg#OpenSans') format('svg'); /* Legacy iOS */
}
/* stylelint-enable */

funny thing is I’m not using the font anywhere … I’m instead importing google fonts via google cdn in setup.php on this project and using a completely different font. so I don’t need the _font.scss file and want to delete it - together with the font in the /fonts folder. but thats not possible, it will break my production build …

As soon as I delete the file _font.scss OR the @import in main.scss on yarn build:production I will get a page without compiled custom scss. I have no clue why this is happening. I tried deleting the dist-folder and the .cache-loader. Of course I also did browser hard refresh, etc … doesn’t help.

yarn buildworks great.

I just don’t get the problem is here … doesn’t make any sense to me. What am I missing?