This site uses cookies to deliver our services. By using this site, you acknowledge that you have read and understand our Cookie and Privacy policy. Your use of Kontext website is subject to this policy. Allow Cookies and Dismiss

ASP.NET Core 2 with Bootstrap 4 Bundler Minifier Issue: Expected semicolon or closing curly-brace found '-'

566 views 1 comments last modified about 6 months ago Raymond

dotnetcore bootstrap

In this page

Background

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

:root{--blue:#007bff;

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

Expected semicolon or closing curly-brace found '-'

image

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:

https://github.com/xoofx/NUglify/issues/17

This issue has not been fixed yet.

It is also raised in GitHub:

https://github.com/madskristensen/BundlerMinifier/issues/295

https://github.com/madskristensen/BundlerMinifier/issues/306

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.

Related pages

Retrieve Http client request metadata like IP address and languages in asp.net core

824 views   0 comments last modified about 9 months ago

IP Address In ASP.NET Core, Request.UserHostAddress has been removed though that attribute exists in the traditional ASP.NET applications. We can use HttpContext.Connection to retrieve the remove client IP address: var ipAddress = HttpContext.Connecti...

View detail

Retrieve Identity username, email and other information in ASP.NET Core

677 views   0 comments last modified about 9 months ago

The identity system in ASP.NET has evolved over time. If you are using ASP.NET Core, you probably found User property is an instance of ClaimsPrincipal in Controller or Razor views. Thus to retrieve the information, you need to utilize the claims.

View detail

Retrieve Azure AppSettings and Connection String Settings in ASP.NET Core Apps

1172 views   0 comments last modified about 9 months ago

In ASP.NET Core, we can easily use user secrets to manage our password or credentials. This post will summarize the approaches we can use after the websites are deployed into Azure.

View detail

Server.MapPath Equivalent in ASP.NET Core 2

3508 views   0 comments last modified about 9 months ago

In traditional asp.net applications, Server.MapPath is commonly used to generate absolute path in the web server. However, this has been removed from ASP.NET Core. So what is the equivalent way of doing it?

View detail

OpenIddict Refresh Token Flow issue ASP.NET Core 2.0

1022 views   0 comments last modified about 10 months ago

Context When I followed OpenIDDict refresh flow sample, I constantly got the issue “The refresh token is no longer valid”, which is returned by the following code in my authorization web api controller: result.Content = new OpenIdConnectResponse &nbsp;&...

View detail

Migrate ASP.NET Core Projects – VS2015 to VS2017 and TFS2015 to TFS2017 Issues and Fixes

383 views   0 comments last modified about 2 years ago

Context Before Visual Studio 2017 was released, I was implementing my ASP.NET Core project using VS2015. TFS2015 is used for Continuous Build and Deployment for my projects. After migrating to VS2017, there are couple of issues I encountered in my environment: VS2017 has ...

View detail

Add comment

Please login first to add comments.  Log in New user?  Register

Comments (1)

RT Re: ASP.NET Core 2 with Bootstrap 4 Bundler Minifier Issue: Expected semicolon or closing curly-brace found '-'

Raym*** about 2 months ago

This issue has now been resolved. 

Raym*** about 2 months ago

This issue has now been resolved.