What are you trying to accomplish
I’m integrating a custom component that uses a reference input field. Functionally, it works fine on the frontend, but in the Builder visual editor, after using this component, newly added components don’t appear in the preview iframe until the user manually refreshes the page.
I’ve stripped everything back to confirm the cause — the reference component’s content model has only a single input, and the referenced model is equally minimal. The issue still occurs regardless of which model is referenced.
Video link
Code stack you are integrating Builder with
Next.js v15.4.1
Builder SDK v6.1.2
Reproducible code example
Below is a simplified version of the content-model.ts for one of the components that triggers the issue. It only contains one reference-type input. The referenced model can be swapped for any other, and the component still works — but the hot-refresh issue persists.
import dynamic from 'next/dynamic';
import { Builder } from '@builder.io/react';
import { Input } from '@builder.io/sdk';
import { BuilderBlockNames } from '@/types/builder';
import { getBuilderIconUrl } from '@/utils/url';
import { BUILDER_MODEL_ID } from '@/constants/builder';
const AlternatingBlockComponent = dynamic(() => import('./index' as string));
const baseConfig = {
friendlyName: 'Alternating Block',
image: getBuilderIconUrl('alternating-block'),
};
const sharedInputs: Input[] = [
{
name: 'internalLinkStandardPage',
friendlyName: 'Link to a Standard page',
type: 'reference',
model: 'standard-page',
helperText: 'Select a Standard page',
},
];
export const registerAlternatingBlockStandardPage = () =>
Builder.registerComponent(AlternatingBlockComponent, {
name: BuilderBlockNames.ALTERNATING_BLOCK,
...baseConfig,
models: [BUILDER_MODEL_ID.STANDARD_PAGE],
inputs: sharedInputs,
});
Observed behaviour
-
After dragging this component onto the preview page and selecting a reference in the
internalLinkStandardPagefield, subsequent components added to the page (even the same one) appear in the Layers panel and are editable. -
However, they only become visibly rendered in the preview iframe about 1 in 5 times.
-
A manual refresh (via the preview URL or page reload) immediately shows all components correctly.
Expected behaviour
The visual editor should update live every time a component is added or removed, even after a component with a reference field has been used.
Additional notes
- The issue only occurs after a reference input is populated in the editor.
- I’ve confirmed it happens on multiple machines and networks.
- Preview updates correctly after a manual refresh, so the data itself is saving fine — it seems specific to the hot-reload path inside the visual editor iframe.
- This happens on local environments and our Vercel-hosted environments.
