question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weird errors when using 'brunch watch'

See original GitHub issue

Running brunch build works fine, but when running brunch watch it executes the initial compilation well but when I edit a file and save it brunch throws errors.

When I edit a CSS file I get this error:

R:\project\node_modules\uglify-js-brunch\lib\index.js:50
        data: optimized.code
                       ^
TypeError: Cannot read property 'code' of undefined
    at UglifyMinifier.module.exports.UglifyMinifier.optimize (R:\project\node_modules\uglify-js-brunch\lib\index.js:50:24)
    at R:\project\node_modules\uglify-js-brunch\lib\index.js:3:59
    at generate (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\generate.js:253:12)
    at gen (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\write.js:93:14)
    at C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\node_modules\async-each\index.js:16:7
    at Array.forEach (native)
    at each (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\node_modules\async-each\index.js:15:11)
    at Object.module.exports.write (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\write.js:95:12)
    at C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\watch.js:266:23
    at FileList.<anonymous> (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\watch.js:523:18)
    at FileList.EventEmitter.emit (events.js:92:17)
    at null._onTimeout (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\file_list.js:115:17)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

When I edit a JS file I get this error:

R:\project\node_modules\uglify-js-brunch\lib\index.js:52
      callback(error, result || data);
      ^
TypeError: string is not a function
    at UglifyMinifier.module.exports.UglifyMinifier.optimize (R:\project\node_modules\uglify-js-brunch\lib\index.js:52:7)
    at R:\project\node_modules\uglify-js-brunch\lib\index.js:3:59
    at generate (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\generate.js:253:12)
    at gen (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\write.js:93:14)
    at C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\node_modules\async-each\index.js:16:7
    at Array.forEach (native)
    at each (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\node_modules\async-each\index.js:15:11)
    at Object.module.exports.write (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\write.js:95:12)
    at C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\watch.js:266:23
    at FileList.<anonymous> (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\watch.js:523:18)
    at FileList.EventEmitter.emit (events.js:92:17)
    at null._onTimeout (C:\Users\myusername\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\file_list.js:115:17)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

After errors I have to rerun brunch watch because it gets killed by the error, although it doesn’t make sense because on the next run it crashes again, always.

Any ideas? Thanks!

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:30 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
es128commented, Oct 16, 2013

I just released a new version of the plugin in case this is somehow related to https://github.com/brunch/uglify-js-brunch/commit/421f79ca2c5fffdf1a1460e530154de674e4fc71.

Run npm update from R:\project\ and try again.

0reactions
thasmocommented, Oct 18, 2013

Alright, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Brunch watch error - ENAMETOOLONG - Stack Overflow
After reinstalling my system I have tried to setup my frontend project and came up with the annoying error with brunch watch which...
Read more >
Watch the Weird and Sad 'Brooklyn Hipster Brunch' Video
"Girlies so fly with their mom jeans tush/Boys' faces hairy like a '70s bush," she raps with crazy eyes. Nadia also shakes a...
Read more >
Sunday Brunch viewers unimpressed with weekend show ...
Sunday Brunch viewers unimpressed with weekend show 'Such a weird awkward vibe'. SUNDAY BRUNCH fans tuned in to watch the Channel 4 show...
Read more >
Watch Tom Hiddleston's Bizarre Chinese Centrum Advert ...
"I finished early so thought I'd pop back and make you breakfast," he says, handing you a plate of what seems to be...
Read more >
36 easy brunch ideas | Features | Jamie Oliver
We've got tonnes of brunch and breakfast recipes right here! ... Whether it's soft, pillowy scrambled eggs with smoked salmon, a pile of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found