brunch / terser-brunch

A javascript minifier for brunch files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError in NPM when using Brunch on Heroku from UglifyMinifier.optimize

gcatto opened this issue · comments

I've recently upgraded Brunch and related libraries (e.g., uglify-js-brunch) to 1.7.x. When pushing to Heroku, I get the error pasted below. Any clues on how I can go about fixing this?

If I remove uglify-js-brunch from my package.json, then it'll work on Heroku.

Thanks!

-----> Installing dependencies

       > xxxx@0.0.1 postinstall /tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0
       > brunch build --production


       /tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0/node_modules/uglify-js-brunch/lib/index.js:48
               data: optimized.code
                              ^
       TypeError: Cannot read property 'code' of undefined
           at UglifyMinifier.module.exports.UglifyMinifier.optimize (/tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0/node_modules/uglify-js-brunch/lib/index.js:48
:24)
           at /tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0/node_modules/brunch/lib/fs_utils/generate.js:220:25
           at fn (/tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0/node_modules/brunch/node_modules/async-waterfall/index.js:19:24)
           at Object._onImmediate (/tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0/node_modules/brunch/node_modules/async-waterfall/index.js:58:22)
           at processImmediate [as _immediateCallback] (timers.js:330:15)

       npm ERR! xxxx@0.0.1 postinstall: `brunch build --production`
       npm ERR! Exit status 8
       npm ERR!
       npm ERR! Failed at the xxxx@0.0.1 postinstall script.
       npm ERR! This is most likely a problem with the xxxx package,
       npm ERR! not with npm itself.
       npm ERR! Tell the author that this fails on your system:
       npm ERR!     brunch build --production
       npm ERR! You can get their info via:
       npm ERR!     npm owner ls xxxx
       npm ERR! There is likely additional logging output above.
       npm ERR! System Linux 3.8.11-ec2
       npm ERR! command "/tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0/vendor/node/bin/node" "/tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0/vendor/node/bin/np
m" "install" "--production"
       npm ERR! cwd /tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0
       npm ERR! node -v v0.10.22
       npm ERR! npm -v 1.3.14
       npm ERR! code ELIFECYCLE
       npm ERR!
       npm ERR! Additional logging details can be found in:
       npm ERR!     /tmp/build_d24a4120-fea7-4048-bddb-66be19b378f0/npm-debug.log
       npm ERR! not ok code 0

Seems like it could be related to #13, but I've been unable to figure it out thus far.

What are exact versions of Brunch and uglify-js-brunch?

brunch: 1.7.12
uglify-js-brunch: 1.7.3

So I set my package.json to be brunch 1.7.10 specifically and all that, then pushed to heroku, but it still breaks in the same way. I checked the brunch version on heroku (via heroku run brunch -v) and it says 1.7.10 there as well.

Note that in both cases (1.7.10 and 1.7.12), it seems to work fine for me locally, just not on heroku.

I get a slightly different stack trace if I use uglify-js-brunch 1.7.0, unsure if that's useful:

-----> Installing dependencies

       > xxxx@0.0.1 postinstall /tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a
       > brunch build --production


       /tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a/node_modules/uglify-js-brunch/lib/index.js:44
          result = optimized && this.options.sourceMaps ? optimized : optimized.code;
                                                                               ^
       TypeError: Cannot read property 'code' of undefined
           at UglifyMinifier.module.exports.UglifyMinifier.optimize (/tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a/node_modules/uglify-js-brunch/lib/index.js:44:76)
           at UglifyMinifier.optimize (/tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a/node_modules/uglify-js-brunch/lib/index.js:3:59)
           at /tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a/node_modules/brunch/lib/fs_utils/generate.js:230:25
           at fn (/tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a/node_modules/brunch/node_modules/async-waterfall/index.js:19:24)
           at Object._onImmediate (/tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a/node_modules/brunch/node_modules/async-waterfall/index.js:58:22)
           at processImmediate [as _immediateCallback] (timers.js:330:15)

       npm ERR! xxxx@0.0.1 postinstall: `brunch build --production`
       npm ERR! Exit status 8
       npm ERR!
       npm ERR! Failed at the xxxx@0.0.1 postinstall script.
       npm ERR! This is most likely a problem with the xxxx package,
       npm ERR! not with npm itself.
       npm ERR! Tell the author that this fails on your system:
       npm ERR!     brunch build --production
       npm ERR! You can get their info via:
       npm ERR!     npm owner ls xxxx
       npm ERR! There is likely additional logging output above.
       npm ERR! System Linux 3.8.11-ec2
       npm ERR! command "/tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a/vendor/node/bin/node" "/tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a/vendor/node/bin/npm" "install" "--production"
       npm ERR! cwd /tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a
       npm ERR! node -v v0.10.22
       npm ERR! npm -v 1.3.14
       npm ERR! code ELIFECYCLE
       npm ERR!
       npm ERR! Additional logging details can be found in:
       npm ERR!     /tmp/build_6387430b-aa68-48db-a9e2-8b83cfcbd77a/npm-debug.log
       npm ERR! not ok code 0

If I use uglify-js-brunch 1.5.x, I get a bit of a different error:

WARN: ERROR: Unexpected character '#' [?:12938,1]
05 Dec 03:12:18 - error: JS minify failed on public/javascripts/vendor.js: Unexpected character '#' (line: 12938, col: 1, pos: 383574)

Error
    at new JS_Parse_Error (/tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:185:18)
    at js_error (/tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:199:11)
    at parse_error (/tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:291:9)
    at Object.next_token [as input] (/tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:523:9)
    at next (/tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:616:25)
    at /tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:721:17
    at /tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:677:24
    at /tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:1395:23
    at Context.parse (/tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:1405:7)
    at /tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/tools/node.js:72:29

The line with the unexpected character is

;#!/bin/sh

This makes me wonder if the problem is actually some kind of error occurring in uglify-js 1.7.x that isn't be handled well and/or uglify-js-brunch isn't capturing?

yeah maybe

Also, for whatever its worth, I'm running Windows locally (where things are working)

This doesn't seem related to brunch/brunch#752

You're running brunch build as an npm postinstall script? Have you tried it with that exact same behavior locally? Does it work on heroku without the --production flag? Any way to run brunch as a separate step from npm install like normal on heroku?

Yeah, running brunch build as an npm postinstall script. When running locally, it works just fine; the issue just seems to occur on Heroku. On Heroku, if I do it without the --production flag or if I remove uglify-js-brunch from my package.json, it works fine.

I tried removing the "postinstall": "brunch build --production" from my package.json and then running brunch build, both with and without the ---production flag, as a separate command to Heroku. The brunch build succeeds, but it fails in the same way as above with the --production flag. It does have the current upside of letting the git push to Heroku succeed (as the errors cause it to fail), then calling brunch after.

+1 Been getting it since heroku did some updates. My take is that for some reason, uglify is currently parsing ALL js files under /node_modules, unless you add conventions for it in your brunch config. This was not needed until recently when heroku updated its installation scheme; apps I could push with ease earlier now throws this err.

/tmp/build_fee5b5c3-3651-4daa-892f-2ca2cf67f1d9/node_modules/uglify-js-brunch/lib/index.js:48
           data: optimized.code
                          ^
   TypeError: Cannot read property 'code' of undefined
       at UglifyMinifier.module.exports.UglifyMinifier.optimize (/tmp/build_fee5b5c3-3651-4daa-892f-2ca2cf67f1d9/node_modules/uglify-js-brunch/lib/index.js:48:24)

Quickfix is doing something like: conventions: ignored: /(^|\/)node_modules\// but then you'll have to import jade-runtime.js – or other vendor files under node_modules/ – manually.
To help with debugging it seems to be independent of brunch version, npm version, node version or uglify-js-brunch version.

@itzaks I get a bit of a different error (see below) if I use uglify-js-brunch 1.5.x and thus a different version of uglify-js. Does the error change for you as well? Also, are you developing on Windows and then pushing to Heroku, by any chance?

05 Dec 03:12:18 - error: JS minify failed on public/javascripts/vendor.js: Unexpected character '#' (line: 12938, col: 1, pos: 383574)

Error
    at new JS_Parse_Error (/tmp/build_e83f71ec-e49e-405b-ae57-de473001b344/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:185:18)

@gcatto I downgraded to uglify-js-brunch 1.5.x and I'm now getting the same error as you.

WARN: ERROR: Unexpected character '#' [?:13024,1]
06 Dec 13:21:01 - error: JS minify failed on public/javascripts/vendor.js: Unexpected character '#' (line: 13024, col: 1, pos: 383858)

Does this config solve it for you?

conventions: { 
  ignored: /(^|\/)node_modules\// 
}

Sadly, I'm at work so won't be able to try that until tonight. Where do I put that additional config?

Just put it in the brunch config files called (brunch-)config.coffee/js :–)

Oh okay, hah. Easy enough, thanks!

That does seem to let brunch build --production succeed on Heroku for me, although I need to figure out how to merge that with the standard conventions.ignored that ignores files that start with _

Easiest enough... brunch build --production still succeeds

Folks. This was an error in uglify-js-brunch. Please upgrade to 1.7.4 — it is now fixed!

Nice, thanks kindly!

Upgraded to 1.7.4
got another error..
JS minify failed on _public/js/vendor.js: Unexpected character '#'

OK i tried
"brunch": "1.7.13",
"uglify-js-brunch": "1.7.4",
And added
ignored: /(^|/)node_modules//

Then it works, But i have to add the ignored line above to make it work.

Same here; it now reports where it fails but it still fails.

error: JS minify failed on public/javascripts/vendor.js: Unexpected character '#' (line: 15276, col: 1, pos: 513116)

I added DEBUG=brunch:* to my postinstall script and here's part of the output:

...
Mon, 09 Dec 2013 09:53:40 GMT brunch:helpers Wrapping is vendor
Mon, 09 Dec 2013 09:53:40 GMT brunch:file-list Compiled file 'vendor/node/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js'...
Mon, 09 Dec 2013 09:53:40 GMT brunch:pipeline Compiling 'vendor/node/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js' with 'AutoReloader'
Mon, 09 Dec 2013 09:53:40 GMT brunch:helpers Wrapping is vendor
Mon, 09 Dec 2013 09:53:40 GMT brunch:file-list Compiled file 'vendor/node/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js'...

Mon, 09 Dec 2013 09:53:40 GMT brunch:generate Concatenating vendor/js/zepto.js, vendor/js/lodash.compat.js, vendor/js/auto-reload.js, vendor/js/exoskeleton.js, node_modules/jade-brunch/vendor/runtime.js, vendor/js/backbone-elements.js, vendor/js/backbone-mediator.js, vendor/js/fx_methods.js, vendor/js/imagesloaded.pkgd.js, vendor/js/jade-runtime.js, vendor/js/jquery.alterclass.js, vendor/js/jquery.magnific-popup.js, vendor/js/modernizr.custom.40620.js, vendor/js/moment.min.js, vendor/js/moment.sv.js, vendor/js/zepto.scroll.js, vendor/js/zprogress.js, vendor/node/lib/node_modules/npm/bin/npm-cli.js, vendor/node/lib/node_modules/npm/bin/read-package-json.js, vendor/node/lib/node_modules/npm/cli.js, vendor/node/lib/node_modules/npm/lib/adduser.js, vendor/node/lib/node_modules/npm/lib/bin.js, vendor/node/lib/node_modules/npm/lib/bugs.js, vendor/node/lib/node_modules/npm/lib/build.js, vendor/node/lib/node_modules/npm/lib/cache.js, vendor/node/lib/node_modules/npm/lib/completion.js, vendor/node/lib/node_modules/npm/lib/config.js, vendor/node/lib/node_modules/npm/lib/dedupe.js, vendor/node/lib/node_modules/npm/lib/deprecate.js, vendor/node/lib/node_modules/npm/lib/docs.js, vendor/node/lib/node_modules/npm/lib/edit.js, vendor/node/lib/node_modules/npm/lib/explore.js, vendor/node/lib/node_modules/npm/lib/faq.js, vendor/node/lib/node_modules/npm/lib/get.js, vendor/node/lib/node_modules/npm/lib/help-search.js, vendor/node/lib/node_modules/npm/lib/help.js, vendor/node/lib/node_modules/npm/lib/init.js, vendor/node/lib/node_modules/npm/lib/install.js, vendor/node/lib/node_modules/npm/lib/link.js, vendor/node/lib/node_modules/npm/lib/ls.js, vendor/node/lib/node_modules/npm/lib/npm.js, vendor/node/lib/node_modules/npm/lib/outdated.js, vendor/node/lib/node_modules/npm/lib/owner.js, vendor/node/lib/node_modules/npm/lib/pack.js, vendor/node/lib/node_modules/npm/lib/prefix.js, vendor/node/lib/node_modules/npm/lib/prune.js, vendor/node/lib/node_modules/npm/lib/publish.js, vendor/node/lib/node_modules/npm/lib/rebuild.js, vendor/node/lib/node_modules/npm/lib/repo.js, vendor/node/lib/node_modules/npm/lib/restart.js, vendor/node/lib/node_modules/npm/lib/root.js, vendor/node/lib/node_modules/npm/lib/run-script.js, vendor/node/lib/node_modules/npm/lib/search.js, vendor/node/lib/node_modules/npm/lib/set.js, vendor/node/lib/node_modules/npm/lib/shrinkwrap.js, vendor/node/lib/node_modules/npm/lib/star.js, vendor/node/lib/node_modules/npm/lib/stars.js, vendor/node/lib/node_modules/npm/lib/start.js, vendor/node/lib/node_modules/npm/lib/stop.js, vendor/node/lib/node_modules/npm/lib/submodule.js, vendor/node/lib/node_modules/npm/lib/substack.js,
...

So it's still minifying and concatenating all files under node_modules/ when building on heroku. Any thoughts on this @paulmillr?

How does your config look like?

Like this (removed conventions, as mentioned above, and server parts; config below currently fails):

exports.config =
  files:
    javascripts:
      joinTo:
        'javascripts/app.js': /^app/
        'javascripts/vendor.js': /^(?!app)/
      order: before: [
          'vendor/js/zepto.js',
          'vendor/js/lodash.compat.js',
          'vendor/js/auto-reload.js'
          'vendor/js/exoskeleton.js'
        ]

    stylesheets: joinTo: 'stylesheets/app.css': /^(app|vendor)/
    templates: joinTo: 'javascripts/app.js'

Super weird shit. No idea why this doesn't happen locally then.

Indeed. I think this started to fail when heroku added some caching magic to node dependencies:

Restoring node_modules directory from cache
-----> Installing dependencies
-----> Pruning dependencies not specified in package.json
-----> Caching node_modules directory for future builds

Are you able to reproduce it?

Can you go through the file system on your heroku space to look at the actual installed version (as defined by package.json) of the uglify-js module? I wonder if heroku is second-guessing npm's semver and installing older versions of something because they have it cached and are assuming it will be ok.

Perhaps do an npm cache clean or otherwise bypass whatever heroku is doing here with the cache.

It seems to be running 1.7.4 as of:

verbose already installed skipping uglify-js-brunch@1.7.4 /tmp/build_e782b5fc-e75d-49eb-9b0d-9fbd616486bc

I also have that version, since recently, explicitly set in package.json "uglify-js-brunch": "1.7.4"

I meant to look at the uglify-js dependency inside of there.

Ah, of course, my mistake. Its 2.3.6.

~/node_modules/uglify-js-brunch $ cd node_modules/uglify-js/
~/node_modules/uglify-js-brunch/node_modules/uglify-js $ cat package.json 
{
  "name": "uglify-js",
  "description": "JavaScript parser, mangler/compressor and beautifier toolkit",
  "homepage": "http://lisperator.net/uglifyjs",
  "main": "tools/node.js",
  "version": "2.3.6",
...

Does not sound right — I have updated it to 2.4.6 recently, on 1.7.4.

Hm strange. Well, I cleared the cache and did npm update on heroku, then pushed.

Now it's 2.4.7 (even!)

~ $ cat node_modules/uglify-js-brunch/node_modules/uglify-js/package.json 
{
  "name": "uglify-js",
  "description": "JavaScript parser, mangler/compressor and beautifier toolkit",
  "homepage": "http://lisperator.net/uglifyjs",
  "main": "tools/node.js",
  "version": "2.4.7",

But brunch build --production still fails with:

09 Dec 15:44:35 - error: JS minify failed on public/javascripts/vendor.js: Unexpected character '#' (line: 14015, col: 1, pos: 562069)

Error
       at new JS_Parse_Error (/tmp/build_a3336ca5-db2c-4ffa-b755-a2f3e834d215/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:196:18)
       at js_error (/tmp/build_a3336ca5-db2c-4ffa-b755-a2f3e834d215/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:204:11)

So, build it without production -- what's on the line 14015?

I don't have a line at 14015 when building without --production because then it doesn't concatenate with all .js files under node_modules/ :–) As referred to earlier it breaks because, for some reason, files not intended for compilation are included in the minifying/concatenating process

Looking at the DEBUG output above gives the impression that heroku might be inserting a symlink in the vendor directory to cause this. Can someone verify?

Assuming that is the underlying cause, I suppose brunch could be updated to ignore vendor/node/lib by default in order to seamlessly support heroku users.

Other project-level solutions would be to rename the vendor dir and redefine it in conventions in brunch config. Or move the entire brunch project into a subdirectory in the repo being pushed to heroku to eliminate the conflict with that top level vendor dir.

Ah, I didn't catch the vendor/node/–path at first sight. But there's no symlink, it's just placed there. Here's the output:

~/vendor $ ls -la
total 28
drwx------ 4 u47271 47271 4096 Dec  9 10:05 .
drwx------ 9 u47271 47271 4096 Dec 10 09:23 ..
drwx------ 2 u47271 47271 4096 Dec  9 10:05 js
-rw------- 1 u47271 47271 7514 Dec  9 10:05 magnific-popup.css
drwx------ 5 u47271 47271 4096 Nov 12 20:25 node
-rw------- 1 u47271 47271 2193 Dec  9 10:05 nprogress.css

And node/ contains the following: ChangeLog LICENSE README.md bin lib share. Perhaps brunch could ignore vendor/node completely?

I suppose. I was hoping to make it specific enough that there was no chance we'd impact someone else who happened to have a desired vendor/node directory for some reason.

Ah :–) Sounds good.

Similar error for me

-----> Installing dependencies

       > ongeza@0.1.1 postinstall /tmp/build_9d5006fb3c2811e78f37949c58deb1af
       > brunch build --optimize

       WARN: ERROR: Unexpected character '#' [?:14794,0]
       22 Oct 09:08:55 - error: JS minify failed on public/javascripts/vendor.js: Unexpected character '#' (line: 14794, col: 0, pos: 449672)

       Error
           at new JS_Parse_Error (/tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:185:18)
           at js_error (/tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:199:11)
           at parse_error (/tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:291:9)
           at Object.next_token [as input] (/tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:523:9)
           at next (/tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:616:25)
           at /tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:721:17
           at /tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:677:24
           at /tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:1395:23
           at Context.parse (/tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/lib/parse.js:1405:7)
           at /tmp/build_9d5006fb3c2811e78f37949c58deb1af/node_modules/uglify-js-brunch/node_modules/uglify-js/tools/node.js:72:29

brunch-config

exports.config =
  # See http://brunch.io/#documentation for docs.
  files:
    javascripts:
      joinTo:
        'javascripts/app.js': /^app/
        'javascripts/vendor.js': /^(?!app)/

    stylesheets:
      joinTo: 'stylesheets/app.css'

    templates:
      joinTo: 'javascripts/app.js'

package.json

{
  "engines": {
    "node": "0.10.32",
    "npm": "2.1.4"
  },
  "engineStrict": true,
  "scripts": {
    "start": "brunch watch --server",
    "test": "brunch test",
    "postinstall": "brunch build --optimize"
  },
  "dependencies": {
    "brunch": "1.6",
    "coffee-script-brunch": ">= 1.0 < 1.7",
    "express": "^4.9.8",
    "handlebars-brunch": ">= 1.0 < 1.7",
    "javascript-brunch": ">= 1.0 < 1.7",
    "uglify-js-brunch": ">= 1.0 < 1.7",
    "clean-css-brunch": ">= 1.0 < 1.7",
    "css-brunch": ">= 1.0 < 1.7",
    "stylus-brunch": ">= 1.0 < 1.7"
  }
}

"postinstall": "brunch build" works fine though.

I'd upgrade to 1.7 but I can't even build on heroku with "postinstall": "brunch build". See #884

@reubano

"postinstall": "brunch build" works fine though.

Not really, you're likely getting all of node's core js in your vendor file. You need to configure brunch to ignore vendor/node or use a newer version of brunch which does that for you.

The only issue you seem to be having with 1.7 is that you did not configure it so heroku would run bower install. brunch build does not do that for you.

Ahh, I see. So you mean like what @paulmillr mentions at http://stackoverflow.com/a/21634556/408556?