Open
Description
I'm not sure if this is a bug, or some problem with my NextJS environment, but in Next 14, I could pass domNode from within the replace() function to other server components, and keep my react customizations more organized. But after upgrading to Next 15, I'm getting the following error:
[ Server ] Error: Converting circular structure to JSON
--> starting at object with constructor 'Element'
| property 'prev' -> object with constructor 'Element'
--- property 'next' closes the circle
Is this a bug?
const options: HTMLReactParserOptions = {
replace(domNode) {
if (domNode instanceof Element && domNode.attribs) {
if (domNode.name === 'ul') {
return <CustomList node={domNode} />;
}
}
}
}