I’m seeing this error in the Dev tools console and the content is not showing in the browser. Inside the Builder Visual Editor everything is looking good and I can see the page with the content loaded correctly.
I’m using Gatsby 2.32.0 and for the @builder dependency they are all updated to the last version.
Hi @anrodriguez , thanks for reporting, can you share more info on your setup and what kind of content you’re previewing ( draft, published, on a url, or just a section ), it’d be perfect if you have a reproduction in a code sandbox for us to look at and help diagnose the issue.
In general the warning you shared shouldn’t cause the page to not load, and I doubt it’s related to the issue of not being able to preview in the browser outside the editor, those are usually issues in how previewing and mounting builder content is handled.
Hi @maythee thank you for sharing your code! Can you please provide more reproduction steps? I wasn’t able to see any errors when I ran your Next.js app. I did notice that the [page].tsx template was set up with single brackets as a dynamic route. I renamed it to [[...page]].tsx for optional catch all routing and it worked ok for me.
Hi @maythee, I do not see a <div> in <div> error but rather a Next.js hydration error. This gets thrown when the second client-side render does not match the initial server-side render and can occur for various reasons. One example is when adding a script with dangerouslySetInnerHTML() and not accounting for rehydration. I would suggest checking that what your rendering on the server also matches the client. If you send me a link to your /sample page I can take a look and see if anything stands out there. It should start with https://builder.io/content/. Thanks!
Hey @maythee it looks like you’re missing some logic to handle when the page is loading which is needed when fallback: true in Next.js. You can take a look at our starter here to see an example of how to handle page load.
@maythee the hydration error disappears for me if I downgrade your webapp to react and react-dom version ^16.14.0 or v17. Can you give that a try and let me know what happens? Thanks.
Also fyi I changed the preview url in your page model options to http://localhost:3000 to make this easier to debug. Feel free to change it back if you need to!
@ancheetah Yes I tried it, the popup disappeared however it just hid the error in the console and was not a long term solution because we can’t upgrade our dependencies.
Hi all, I spoke with one of our engineers at Builder.io and we are still investigating the root cause with v18. I can let you know when we have a fix, pending the release of this pr.
Another update, we may have a fix for the React SDK but it has not been released yet. In the meantime a workaround could be to switch from SSG to SSR with getServerSideProps.