2

I'm using Asp.Net's Bundling and Minification feature and I have a bundle of CSS files in a staging environment where debug is set to false to emulate production. For some time now I've had an error in asp.net's minification function in both staging and production environments:

Minification failed. Returning unminified contents.
(11479,6713): run-time error CSS1030: Expected identifier, found '['
(11479,6718): run-time error CSS1031: Expected selector, found '='
(11479,6718): run-time error CSS1025: Expected comma or open brace, found '='

This is what I see on Chrome's DevTools. I fixed the issues and tested it locally with debug turned off. This message went away and the files were successfully minified. However when I publish the css files to the staging server I still get the error. When I look at the CSS, prettyfied by Devtools, I notices that my changes are not there.

I've checked the usual suspects: wrong file published, published to wrong server and none of it is the case. According to this post the bundle is supposed to update the cache whenever there are changes to the files. But this isn't happening for some reason. Any ideas?

Another weird thing is that when I remove the offending file from the bundle, it is still served up by the minifier.

Community
  • 1
  • 1
Necromancer
  • 390
  • 5
  • 15

1 Answers1

1

In your error above (11479,6713): 11479 is the line number and 6713 is the character offset. So you need remove the whole comment where this error is appear. I think you have both .css and .min.css file included. In that case please check this, its explained clearly here

Community
  • 1
  • 1
Basanta Matia
  • 1,504
  • 3
  • 15
  • 27
  • I already stated that I fixed the issues indicated and I am not including both css and min files. Asp.net minification does not output *.min files, it creates a resource of all the css files in the bundle, minified. – Necromancer Mar 15 '17 at 12:40