Describe the issue:
We’re seeing the following errors from marketplace plugins as well as private plugins:
[Plugin SDK] Hook customMarksForStructuredTextField() on plugin XXXXXX failed with the following error: Error: Unexpected return value!
(Recommended) What’s the URL of the record or model in question?
I have verified that this issue happens on our production instance and a fresh test project datocms instance (using the marketing template, deleting all but custom marks for structured text plugins).
(Optional) Do you have any sample code you can provide?
-
Install the Extended Structure Text marketplace plugin or Format Sub- Superscript marketplace plugin
-
Edit any structured text field
-
Hopefully reproduce the following warnings in question.
-
the given custom marks will not be rendered in the structured text editor.
As far as I can tell this code should still work from my cursory reading of the new types in the datocms-plugin-sdk@ 2.0.9
. Has something changed on the plugin lifecycle side that we are not aware of? The documentation on how the plugin lifecycle works is a bit sparse though any references would be helpful.
connect({
renderConfigScreen(ctx) {
return render(<ConfigScreen ctx={ctx} />);
},
customMarksForStructuredTextField(field, ctx) {
return [
{
id: 'subscript',
label: 'Subscript',
icon: 'subscript',
keyboardShortcut: 'ctrl+shift+d',
appliedStyle: {
verticalAlign: 'sub',
fontSize: '0.5rem',
},
},
];
},
});
We cannot use a few custom marks for structured text plugins at the moment and it is quite important to our content. I’ve tried creating creating a fresh new local plugin from templr via the instructions on the docs and upgrading it to the latest dato-plugin-sdk but still see the same error.
Any ideas how we can resolve this?