Node.js buffer + lz4 issues - buffer.js:705 throw TypeError('value is out of bounds')

I have the following line in my node.js script that is generating a fatal error:

var compressedOutput = lz4.encode(new Buffer(logdata,"utf8"));

The variable 'logdata' contains a string I create with http request parameters. Is this an issue with lz4 or the way I'm creating my buffer? How can I resolve? Error message is below:

    buffer.js:705
    throw TypeError('value is out of bounds');
          ^
TypeError: value is out of bounds
    at TypeError (<anonymous>)
    at checkInt (buffer.js:705:11)
    at Buffer.writeInt32LE (buffer.js:782:5)
    at Encoder._flush (/var/www/node_modules/lz4/lib/encoder_stream.js:210:7)
    at Encoder.<anonymous> (_stream_transform.js:130:12)
    at Encoder.g (events.js:180:16)
    at Encoder.emit (events.js:92:17)
    at finishMaybe (_stream_writable.js:359:12)
    at endWritable (_stream_writable.js:366:3)
    at Encoder.Writable.end (_stream_writable.js:344:5)
worker 3884 died

Thanks and much appreciated!