You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been attempting to use the CsvWriter mixin to write a stream of Objects to a csv.
Upon writing the final record to the csv, the CsvWriter errors out (as described below).
TypeError: May not write null values to stream
at validChunk (_stream_writable.js:184:10)
at CsvTransformStream.Writable.write (_stream_writable.js:218:12)
at Pump.<anonymous> (/Users/..../.../.../node_modules/datapumps/lib/mixin/CsvWriterMixin.js:27:35)
at emitNone (events.js:91:20)
at Pump.emit (events.js:185:7)
at Pump.module.exports.Pump._outputBufferEnded (/Users/.../.../.../node_modules/datapumps/lib/Pump.js:233:19)
at emitNone (events.js:86:13)
at Buffer.emit (events.js:185:7)
at Buffer.seal (/Users/.../.../.../node_modules/datapumps/lib/Buffer.js:149:14)
at Pump.module.exports.Pump.sealOutputBuffers (/Users/.../.../.../node_modules/datapumps/lib/Pump.js:273:32)
at Pump.module.exports.Pump._pump (/Users/.../.../.../node_modules
Here is the CsvWriter mixin code (as pulled from node_modules):
(function(){varCsvWriterMixin,Promise,csv,fs;csv=require('fast-csv');fs=require('fs');Promise=require('bluebird');CsvWriterMixin=function(options){if(!(options!=null ? options.path : void0)){thrownewError('path option is required.');}returnfunction(target){target.writeRow=function(row){returntarget._csv.writer.writeAsync(row);};target._csv=options;target._csv.writer=Promise.promisifyAll(csv.createWriteStream());target._csv.writer.pipe(fs.createWriteStream(target._csv.path,{encoding: 'utf8'}));if(target._csv.headers!=null){target.writeRow(target._csv.headers);}returntarget.on('end',function(){returntarget._csv.writer.write(null);});};};module.exports=CsvWriterMixin;}).call(this);
I've resolved the issue locally by updating this line of code:
I've been attempting to use the CsvWriter mixin to write a stream of Objects to a csv.
Upon writing the final record to the csv, the CsvWriter errors out (as described below).
Here is the CsvWriter mixin code (as pulled from node_modules):
I've resolved the issue locally by updating this line of code:
to
The text was updated successfully, but these errors were encountered: