Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object(...) is not a function Error after updating to Node 18 #30

Open
benjaminchallenor opened this issue Sep 12, 2023 · 1 comment
Open

Comments

@benjaminchallenor
Copy link

benjaminchallenor commented Sep 12, 2023

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,
      },
....
@marcelofinamorvieira
Copy link
Contributor

marcelofinamorvieira commented Sep 15, 2023

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: datocms/vue-datocms#87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants