When upgrading Bootstrap to v4.0.0 release, the bundler and minifier doesn’t work properly due to CSS variable is commonly used:


About 26 errors will show up in the Error List with the following message:

Expected semicolon or closing curly-brace found '-'


The environment in my machine has the following setup:

  • VS2017 15.5.4
  • <PackageReference Include="BuildBundlerMinifier" Version="2.6.362" />

Downgrading the package to 2.5.357 doesn't fix the problem in my environment though some people mentioned it can work.

Issue Cause

This issue in BuildBundlerMinifier is caused by another issue in package NUglify:

This issue has not been fixed yet.

It is also raised in GitHub:

Resolution or Workarounds

Temporary fix

Before this issue is fixed, you can use any of the following approaches to get it work:

  • downgrade your Bootstrap 4 version to beta versions
  • or you change your code temporarily not to minimize bootstrap CSS4 file. You can still bundle and minify your other CSS files which are not using CSS variables.
  • or temporarily manually modify your Bootstrap 4 CSS file to remove that :root section if you are not using bower or other package managers to install those client packages.

I will keep this post updated when the issue is fixed permanently.

info Last modified by Raymond at 9 months ago * This page is subject to Site terms.

More from Kontext

Bootstrap 4 Mega Full Width Dropdown Menu

local_offer HTML local_offer Javascript local_offer bootstrap

visibility 85
thumb_up 0
access_time 3 months ago

On Kontext, a full width mega dropdown menu is implemented using Bootstrap 4. If you'd like to implement similar menus, please follow these steps.  Environment The following code snippets work with Bootstrap 4.4.1. It should also work with other 4.x versions but I didn't test i...

open_in_new Frontend & Javascript

Modern Web Application - Azure Blob Storage for Uploaded Files

local_offer Azure local_offer core local_offer dotnetcore

visibility 308
thumb_up 0
access_time 3 months ago

With cloud platforms like Azure, we can totally separate user content storage from web application storage to decouple components from each other and to make the application easy to scale and deploy. This article provides detailed information with code snippets about how to use Azure server-less product Blob Storage and App Service to enable horizontally scalable web application for users to upload files (BLOBs).

open_in_new Azure

local_offer core 2 local_offer core local_offer dotnetcore local_offer open-banking

visibility 243
thumb_up 0
access_time 2 years ago

I’ve just started an core 2.2 based implementation for Australia Consumer Data Standards (published by Data 61). Opening Banking initiative will follow these standards. The purpose is to help you to get familiar with these standards, especially the APIs that need to be implemented. ...

open_in_new ASP.NET Core

info About author

comment Comments (3)

comment Add comment

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts



This should has been fixed now according to the issues trackers on GitHub. If you are still encountering this problem, please report to the project site on GitHub.

BTW, I've migrated to use Gulp to package my client resources. Refer to the following page for more details:

Migrate from Bower to Gulp for Client Libraries Management in ASP.NET Core


person G Swanson access_time 9 months ago
Re: ASP.NET Core 2 with Bootstrap 4 Bundler Minifier Issue: Expected semicolon or closing curly-brace found '-'

I am still getting the problem. What do I need to upgrade to fix it?

I am using Visual Studio 2019 and most of my nuget packages are pretty recent.

reply Reply
account_circle G Swanson

I am still getting the problem. What do I need to upgrade to fix it?

I am using Visual Studio 2019 and most of my nuget packages are pretty recent.

reply Reply

Dark theme mode

Dark theme mode is available on Kontext.

Learn more arrow_forward

Kontext Column

Created for everyone to publish data, programming and cloud related articles. Follow three steps to create your columns.

Learn more arrow_forward