browserify / watchify

watch mode for browserify builds
Other
1.79k stars 203 forks source link

Invalid left-hand side expression in prefix operation #298

Closed FrankFang closed 8 years ago

FrankFang commented 8 years ago
$ watchify resume.yaml -o "echo 1"
/usr/local/lib/node_modules/watchify/node_modules/syntax-error/index.js:13
        if (err.constructor.name !== 'SyntaxError') throw err;
                                                    ^

ReferenceError: Invalid left-hand side expression in prefix operation
    at module.exports (/usr/local/lib/node_modules/watchify/node_modules/syntax-error/index.js:8:52)
    at DestroyableTransform._transform (/usr/local/lib/node_modules/watchify/node_modules/browserify/index.js:638:23)
    at DestroyableTransform.Transform._read (/usr/local/lib/node_modules/watchify/node_modules/readable-stream/lib/_stream_transform.js:172:10)
    at DestroyableTransform.Transform._write (/usr/local/lib/node_modules/watchify/node_modules/readable-stream/lib/_stream_transform.js:160:12)
    at Labeled.Pipeline._write (/usr/local/lib/node_modules/watchify/node_modules/stream-splicer/index.js:70:22)
    at doWrite (/usr/local/lib/node_modules/watchify/node_modules/readable-stream/lib/_stream_writable.js:335:12)
    at writeOrBuffer (/usr/local/lib/node_modules/watchify/node_modules/readable-stream/lib/_stream_writable.js:321:5)
    at Labeled.Writable.write (/usr/local/lib/node_modules/watchify/node_modules/readable-stream/lib/_stream_writable.js:248:11)
    at Labeled.ondata (/usr/local/lib/node_modules/watchify/node_modules/readable-stream/lib/_stream_readable.js:583:20)
    at emitOne (events.js:77:13)
$ watchify --version
watchify v3.7.0 (in /usr/local/lib/node_modules/watchify)
browserify v13.0.0 (in /usr/local/lib/node_modules/watchify/node_modules/browserify)
mattdesl commented 8 years ago

I'm not sure what you are trying to do but this seems incorrect:

watchify resume.yaml -o "echo 1"

First; you should be running watchify on JavaScript (.js) files, and second the -o flag should typically be a file output like -o bundle.js.

FrankFang commented 8 years ago

My bad.