Error: "Cell with term key not found in head."

I’m using the dynamic table (https://atlaskit.atlassian.com/packages/design-system/dynamic-table) and I am getting this error. I’ve tried every variation I can think of and I cannot get rid of it.
This is way my data looks:

head: {
      cells: [
        {
          key: "name",
          content: "Name",
          isSortable: true,
          shouldTruncate: false,
          width: 38,
        },
        {
          key: "description",
          content: "Description",
          isSortable: true,
          shouldTruncate: true,
          width: 50,
        }
    ]
   }
rows: [
      {
        cells: [
          {
            key: "name",
            colspan: 2,
            content: "ExpressJS",
          },
          {
            key: "description",
            colspan: 3,
            content: "Node JS web development framework",
            isSortable: true,
          },
        ]
     }
]

Please help me get rid of this error.

I’m going to take a stab in the dark on this one.

You have specified colspan on your row cells but no colspan on your head cells. I would assume those would have to match.

So your head has 2 columns but your rows has 5.

The error to me sounds like it can’t find what the head should be on the 3rd column?

In my case, the issue was with the defaultSortKey property of the DynamicTable component.

The defaultSortKey property was set to a key that didn’t exist in my table, so DynamicTable couldn’t find it and threw an error (this explains why my table was functioning fine, except that there wasn’t a sorted header by default).

<DynamicTable
					
	defaultSortKey="name" // key didn't exist in the table headers.
			
/>