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

265 views Asked by At

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?

Thanks!

-----> Installing dependencies

       > [email protected] 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! [email protected] postinstall: `brunch build --production`
       npm ERR! Exit status 8
       npm ERR!
       npm ERR! Failed at the [email protected] 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
1

There are 1 answers

0
GLC On BEST ANSWER

This was actually fixed in v1.7.4 of uglify-js-brunch