Fails to compile CSS with @-moz-document url-prefix() #736

Closed
scyclops opened this Issue Nov 24, 2013 · 4 comments

3 participants

@scyclops

I use jQuery Mobile which uses the @-moz-document url-prefix() css hack to target Firefox (see: http://css-tricks.com/snippets/css/css-hacks-targeting-firefox/ & https://developer.mozilla.org/en-US/docs/Web/CSS/@document ).

The issue I'm running into is that Brunch fails to compile the jQuery Mobile css when these css hacks are present. I recently upgraded from Brunch 1.5 to the latest 1.7 version. The compilation succeeded in 1.5 but is failing in 1.7. You can find the jQuery Mobile css at the link below:

http://code.jquery.com/mobile/1.4.0-rc.1/jquery.mobile-1.4.0-rc.1.css

The error that Brunch outputs is:

24 Nov 10:37:59 - error: Compiling of 'vendor/css/jquery.mobile-1.4.0-rc.1.css' failed. Cannot read property 'length' of undefined

I have css-brunch & clean-css-brunch as dependencies. I only run into this issue when doing "brunch w" so I assume it's Brunch itself or css-brunch that's having a problem. Apologies if this issue should have been filed against css-brunch.

@es128
Brunch member

Looks like it might be version mismatch between brunch and plugins. What does your package.json look like, and what is the output of brunch --version? Have you done npm install in your project since upgrading brunch?

@scyclops

brunch --version outputs 1.7.10

I have run npm install and npm up within the last few hours.

package.json has:

{
  ...

  "engines": {
    "node": "0.10"
  },

  "scripts": {
    "start": "brunch watch --server",
    "test": "brunch test"
  },

  "dependencies": {
    "javascript-brunch": ">= 1.0 < 1.8",
    "css-brunch": ">= 1.0 < 1.8",
    "uglify-js-brunch": ">= 1.0 < 1.8",
    "clean-css-brunch": ">= 1.0 < 1.8",
    "handlebars-brunch": ">= 1.0 < 1.8",
    "stylus-brunch": ">= 1.0 < 1.8",
    "autoprefixer-brunch": ">= 1.0 < 1.8",

    "imageoptmizer-brunch": "0.0.4",
    "node-smushit": "0.5.1"
  },
  "devDependencies": {}
}
@scyclops

Oops, I just discovered it was autoprefixer causing the problem. I had removed autoprefixer's config from my config.coffee file but didn't realize it was still running as long as it was listed as a dependency. After removing it as a dependency, the css file compiled successfully.

@scyclops scyclops closed this Nov 24, 2013
@lydell

Yeah, it was autoprefixer–or, more precisely, my fork of autoprefixer that is used by the autoprefixer-brunch plugin. I recognize that error message ;) That's the only test that my fork doesn't pass. BTW, if you need autoprefixer but don't need source maps, you could just swap the autoprefixer dependency in the plugin, or wait until source map support lands in the original version (probably at the end of the year).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment