Hi @hannahlincoln,
I believe this to be a conflict with the HubSpot forms. If you open the browser’s developer tools when the problem occurs, you can see this error message in the console:
TypeError: Cannot read property 'createPortal' of undefined
createPortal
is part ReactDOM, which is included in WordPress core. We use the React libraries bundled with WordPress to render the preview frame. When I check to see what version of React is used in the preview frame, it’s much older. This means something is overwriting the version from WordPress. I think the problem goes something like this:
- The preview loads
- Pro is able to render the preview using the correct version of React
- The Hubspot scripts run and the form is setup
- Hubspot’s script also overwrite the version of React on the page
- Pro expects to use the version of React that is included in WordPress core and can no longer operate properly
I’ve commented out the form in the footer, and on this page:
https://staging.itassolutions.co.uk/pro/content/24838
You should see the builder is working again at this point with the form disabled.
Regretfully, right now there isn’t a good workaround. It would be helpful if we had an element or an option on the Raw Content element to allow inserting embed codes that don’t render at all in the live preview to avoid polluting it. We’ll consider adding an option like this. It works on the front end. However, you still have the issue of React being overwritten. That is a core WordPress javascript library so you could run into other conflicts with plugins that expect React to be available.
It might be worth reaching out to HubSpot to see if they have a way to embed a form that doesn’t contaminate the global scope like this.