Ok I ran into that issue, couldn't find any clue on the forum but eventually managed to fix it. Hope this can save time to anyone having the same problem.
I have a form that I instantiate in the getEditForm() method of the ModelAdmin class. That form shows a list of DataObject using the very handy GridField, and I wanted to have an "Add New" button, located after the GridField on the left (instead of the default location, which is before on the left) :
$list = $this->getList();
$fieldConfig = GridFieldConfig_RecordViewer::create();
$fieldConfig->addComponent(new GridFieldAddNewButton('buttons-after-left'));
$gridField = new GridField($this->modelClass, false, $list, $fieldConfig);
but for some reason, I was stuck with the following error message :
GridField HTML fragment 'buttons-after-left' was given content, but not defined. Perhaps there is a supporting GridField component you need to add
SOLUTION
The solution for this might seem straightforward for some people, but it wasn't for me.
You actually need to add a component GridFieldButtonRow in the GridField configuration object before adding your button in the 'button-after-left' fragment :
$list = $this->getList();
$fieldConfig = GridFieldConfig_RecordViewer::create();
$fieldConfig->addComponent(new GridFieldButtonRow('after'));
$fieldConfig->addComponent(new GridFieldAddNewButton('buttons-after-left'));
$gridField = new GridField($this->modelClass, false, $list, $fieldConfig);
Hope that helps