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
{{ message }}
This repository was archived by the owner on May 20, 2026. It is now read-only.
buffer.js:557
throw new TypeError('Unknown encoding: ' + encoding);
^
TypeError: Unknown encoding:
at stringSlice (buffer.js:557:9)
at Buffer.toString (buffer.js:593:10)
at CSVStream.write (/(...)/node_modules/csv-stream/index.js:59:34)
at IncomingMessage.ondata (_stream_readable.js:626:20)
at emitOne (events.js:115:13)
at IncomingMessage.emit (events.js:210:7)
at IncomingMessage.Readable.read (_stream_readable.js:462:10)
at flow (_stream_readable.js:833:34)
at resume_ (_stream_readable.js:815:3)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
I can fix this by adding the following to my code:
csvStream._encoding='utf8'
But this is an ugly hack that I want to avoid at all cost.
Is there any way to fix this from my side? Am I missing something? Or should csv-stream set a value for this._encoding coming from options or something similar?
I'm using
csv-streamwith express to parse a request stream (file).This is the code I'm using:
When I run this, I get this error:
I can fix this by adding the following to my code:
But this is an ugly hack that I want to avoid at all cost.
Is there any way to fix this from my side? Am I missing something? Or should
csv-streamset a value forthis._encodingcoming fromoptionsor something similar?