#in dev, error rect-dom createRoot

1 messages · Page 1 of 1 (latest)

onyx flicker
fiery knollBOT
#

Hi @onyx flicker. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The error message you're seeing suggests that the createRoot function is not being exported from the react-dom module. This could be due to a variety of reasons, such as using an older version of React that doesn't include this function, or a misconfiguration in your project.

In Astro, React components loaded with client:only should probably use createRoot instead of hydrateRoot. However, the use of createRoot and hydrateRoot is avoided by design in Astro. Using createRoot will blow away any server-rendered children passed to a client:only component. This is why Astro hydrates with hydration suppression warnings today. More fundamental changes might be needed to address this issue source (https://github.com/withastro/astro/issues/3010).

If you're using an older version of React, you might need to update to a version that includes the createRoot function. If you're already using a recent version of React, there might be an issue with how your project is configured.

Without more specific information about your project setup, it's difficult to provide a more precise answer. If you're still having trouble, I would recommend checking the Astro GitHub issues (https://github.com/withastro/astro/issues) for similar problems or opening a new issue there.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: