Skip to content

[Bug]: Cannot Read Properties of undefined (reading 'map') when headers aren't provided #102

@ondrovic

Description

@ondrovic

Headers are optional but in certain instances throws the following error

TypeError: Cannot read properties of undefined (reading 'map')
    at ObjectCsvStringifier.getRecordAsArray (C:\Users\ondro\source\git\test-csv-writer\node_modules\csv-writer\src\lib\csv-stringifiers\object.ts:21:30)
    at C:\Users\ondro\source\git\test-csv-writer\node_modules\csv-writer\src\lib\csv-stringifiers\abstract.ts:20:77
    at Function.from (<anonymous>)
    at ObjectCsvStringifier.CsvStringifier.stringifyRecords (C:\Users\ondro\source\git\test-csv-writer\node_modules\csv-writer\src\lib\csv-stringifiers\abstract.ts:20:32)
    at CsvWriter.<anonymous> (C:\Users\ondro\source\git\test-csv-writer\node_modules\csv-writer\src\lib\csv-writer.ts:17:51)
    at step (C:\Users\ondro\source\git\test-csv-writer\node_modules\csv-writer\dist\lib\csv-writer.js:33:23)
    at Object.next (C:\Users\ondro\source\git\test-csv-writer\node_modules\csv-writer\dist\lib\csv-writer.js:14:53)
    at C:\Users\ondro\source\git\test-csv-writer\node_modules\csv-writer\dist\lib\csv-writer.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\ondro\source\git\test-csv-writer\node_modules\csv-writer\dist\lib\csv-writer.js:4:12)

Code Sandbox Here, if not sure if it's a bug in my setup or something else, but would be nice to not have to include a header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions