'Bundler & Minifier error 0: Expected closing parenthesis, found ','
I am getting some really annoying errors when debugging my ASP .NET Core application in VSCode.
It seems to be related to my css bundler/minifier, but I have no idea how this is possible as it was working fine Friday afternoon but this morning it is having issues.
My css looks like this:
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Hide/rearrange for smaller screens */
@media screen and (max-width: 767px) {
/* Hide captions */
.carousel-caption {
display: none;
}
}
.high {
background-color: rgb(255,0,0,0.5);
}
.medium {
background-color: rgb(255,255,0,0.5);
}
.low {
background-color: whitesmoke;
}
#test {
background: blue;
}
When I try to debug, I get these errors
c:\Users\bassie\Documents\VSCode\DSSTools\wwwroot\css\site.min.css(22,34,22,34): Bundler & Minifier error 0: Expected closing parenthesis, found ',' [c:\Users\bassie\Documents\VSCode\DSSTools\DSSTools.csproj]
c:\Users\bassie\Documents\VSCode\DSSTools\wwwroot\css\site.min.css(22,34,22,34): Bundler & Minifier error 0: Expected function, found ',' [c:\Users\bassie\Documents\VSCode\DSSTools\DSSTools.csproj]
c:\Users\bassie\Documents\VSCode\DSSTools\wwwroot\css\site.min.css(22,38,22,38): Bundler & Minifier error 0: Expected semicolon or closing curly-brace, found ')' [c:\Users\bassie\Documents\VSCode\DSSTools\DSSTools.csproj]
c:\Users\bassie\Documents\VSCode\DSSTools\wwwroot\css\site.min.css(26,36,26,36): Bundler & Minifier error 0: Expected closing parenthesis, found ',' [c:\Users\bassie\Documents\VSCode\DSSTools\DSSTools.csproj]
c:\Users\bassie\Documents\VSCode\DSSTools\wwwroot\css\site.min.css(26,36,26,36): Bundler & Minifier error 0: Expected function, found ',' [c:\Users\bassie\Documents\VSCode\DSSTools\DSSTools.csproj]
c:\Users\bassie\Documents\VSCode\DSSTools\wwwroot\css\site.min.css(26,40,26,40): Bundler & Minifier error 0: Expected semicolon or closing curly-brace, found ')' [c:\Users\bassie\Documents\VSCode\DSSTools\DSSTools.csproj]
If I delete all my css the errors go away.
I also noticed that if I delete just the 3 css rules (high, medium, low), the errors also go away.
What am I supposed to do with these errors, and how can I debug these types of messages?
Solution 1:[1]
I see that the first error is
Expected closing parenthesis, found ','
And you have
background-color: rgb(255,0,0,0.5);
in a couple of places. That version - rgb - does not expect an alpha value and presumably sets off all the errors. Finding a period where it expects the closing parenthesis. Try:
background-color: rgba(255,0,0,0.5);
instead in your .high and .medium declarations.
Solution 2:[2]
This stupid thing wasted so much of time. Simply remove the item in question from the bundleconfig.json and do a build. It will succeed. Then add the item back to the bundleconfig.json and build again. It should succeed.
Solution 3:[3]
In my experience I have found that this is caused by:
rgba
colours having four values e.g.,rgba(255, 122, 122, 0.15)
;rgb
colours having only three values e.g.,rgb(255, 122, 122)
.
These should be updated accordingly.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | CodingYoshi |
Solution 3 |