Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Key error passed silently  #725

@levi-x00

Description

@levi-x00

I just spot this, I think there should be an error handler for this

// ...... some codes here ......

// === define columns === 
worksheet.columns = [
    { header: 'Id', key: 'id', width: 10 },
    { header: 'Name', key: 'name', width: 32 },
    { header: 'D.O.B.', Key: 'DOB', width: 10 }, // <-- we should've use 'key' instead of 'Key', but when I use 'Key' there are no errors
];

// === when inserting values for each row === 
worksheet.addRow({ id: 1, name: 'John Doe', DOB: new Date(1970, 1, 1) });
worksheet.addRow({ id: 2, name: 'Jane Doe', DOB: new Date(1965, 1, 7) });
worksheet.addRow({ id: 3, name: 'John Doe', DOB: new Date(1970, 3, 1) });
worksheet.addRow({ id: 4, name: 'Jane Doe', DOB: new Date(1965, 4, 7) });

// ...... some codes here ......

it took me hours to debug it.

Best Regards

Levi

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions