Yarn build:production fails on Bootstrap compilation

Hi there,

I’m trying to yarn build:production, but I keep getting an error related to Bootstrap. I’m on Sage 9.0.10.

The error originates in bootstrap/scss/_navbar.scss on line 229. When I delete the background-image rule, the build process finishes correctly.

I’ve included Bootstrap at the top of my main.scss file. When I comment out my code and only compile Bootstrap, the error persists, so it’s not related to my own sass.

I’m confused and don’t know how to debug this problem. Any help would be greatly appreciated.

You may be interested in the latest Sage 9.x version:

It fixes a lot of build issues.

I came across this post:

How would you go about updating Sage? I’m a little afraid to break it. I’ll try it on a copy of the project, but I would not know the best way to go ahead.

Also, @ben clearly states that an update should not be necessary. So I’m wondering if it’s even necessary.

See this guide for updating an existing Sage 9 theme:

Well, the latest Sage 9.x updates update a lot of dependency, hence fixing lots of issues.
You don’t have to update… but sometimes it can fix the root causes.

What is the error you’re getting? What version of Bootstrap are you trying to use?

Bootstrap 4.3.1 and the error is:

error  in ./resources/assets/styles/main.scss

Module build failed: ModuleBuildError: Module build failed: Syntax Error 

(6813:72435) Unclosed block

When I delete the line I mentioned in my original post, the build finishes succesfully.

Edit: full output

Have you tried updating Bootstrap to a more recent version? It sounds like Sage’s version of Sass and that version of Bootstrap disagree on some standards.

Upgrading Bootstrap to 4.6.1 did the trick, thanks @MWDelaney.