structured-text
structured-text copied to clipboard
Object(...) is not a function Error after updating to Node 18
Hi, we testing updating our site to node 18. We are using datocms-structured-text-generic-html-renderer v2.0.4 in an accordion component. The render function is now returning the error Object(...) is not a function. A snippet of how we are using the function can be found below:
const defaultAdapter = {
renderNode: hAdapter,
renderMark: hAdapter,
renderFragment: (children, key) => createElement('div', { key }, children),
renderText: (text) => text,
}
return render(
{
renderText: this.renderText || defaultAdapter.renderText,
renderNode: this.renderNode || defaultAdapter.renderNode,
renderFragment: this.renderFragment || defaultAdapter.renderFragment,
},
....
Hello @benjaminchallenor
Can you confirm that if you downgrade the node to a previous version the same snippet works? If so, can you provide us with a step by step way to reproduce this on our end? As i tried with a generic render and Node 18 and couldn’t reproduce the issue :(
Perhaps you are experiencing something similar to the issue solved here: https://github.com/datocms/vue-datocms/issues/87