Drag-and-Drop Editor Works in Local but Not in Production (Next.js 15 + ShadCN Integration)

I’m reaching out because we’ve been running into an issue where the Builder drag-and-drop editor works fine locally but does not function in our production deployment on Vercel. I’d like to provide a detailed breakdown of our setup and the troubleshooting steps we’ve already taken so you have full context.


Setup & Environment

  • Framework: Next.js 15.4.5 (App Router)

  • React: 19.1.0

  • Builder SDKs:

    • @builder.io/react@8.2.6

    • @builder.io/sdk-react for rendering content

  • Styling/UI: shadcn/ui components

  • Deployment: Vercel (production + preview)

  • We are embedding Builder inside an iframe using the Preview URL.


The Issue

  • Locally (npm run dev):

    • Builder drag-and-drop editor works correctly.

    • We can add new components and edit existing ones with no problems.

  • On Vercel (production):

    • The iframe loads and content renders.

    • However, the drag-and-drop editor is not functional:

      • Components display in the editor but cannot be dragged, edited, or rearranged.
    • The Builder editor reports:

      • Iframe evaluation timeout – no response within 10000ms

      • Could not evaluate in iframe (MobX-related downstream error).


Debugging Already Done

Step 0: Verified environment & networking

  • Deployment protection and x-vercel-protection-bypass secret configured correctly.

  • Verified Preview URL works directly in browser.

  • Confirmed no ad-blockers, cookies, or proxy interference.

Code changes made for debugging:

  1. Added a minimal playground layout (src/app/builder-playground/layout.tsx)

    • Stripped out fonts, analytics, global CSS, and wrappers.

    • Only renders the iframe + Builder content.

  2. Added diagnostic logs (PlaygroundClient.tsx):

    • Checked window.Builder object, builder.apiKey, environment, user agent.

    • All values initialize correctly.

  3. Refactored Builder initialization:

    • Created src/lib/builder.ts to call builder.init(NEXT_PUBLIC_BUILDER_API_KEY) once.

    • Imported this at the top of layout.tsx.

    • Removed duplicate builder.init calls from page components.

  4. Verified Vercel settings:

    • Proxy previews toggled ON/OFF for testing.

    • CSP headers checked.

    • Edge runtime disabled for test builds.


Current Status

  • All network/security/CSP issues are now resolved.

  • The app iframe loads with zero network errors.

  • The new root problem is communication between Builder editor and the iframe:

    • The parent window sends “Are you ready?” message.

    • Our app never responds within the 10s timeout.

    • This breaks drag-and-drop, while static rendering still works.

  • In short:

    • Builder SDK initializes correctly.

    • Content renders correctly.

    • But the bridge between editor → iframe → SDK never fully handshakes in production.


Questions

  1. Are there known issues with @builder.io/react@8.2.6 and Next.js 15 + React 19 in production builds?

  2. Is there a required placement for builder.init() (e.g., must run outside of React lifecycle, or inside a specific client hook) to avoid timeouts?

  3. Could production tree-shaking or React strict mode affect the iframe handshake timing?

  4. Do you recommend additional configuration in Builder Dashboard (e.g., disabling proxy previews, adjusting iframe evaluation settings)?


Next Steps

We are very close — local works perfectly, production is just failing on the iframe handshake.
If you could guide us on best practices for Builder initialization in Next.js 15 App Router and/or any production-specific configuration, that would be extremely helpful.

Thanks in advance for your support — happy to share logs, configs, or even access to our preview deployment if needed.

Best regards,

Sunita Negi

Please fill out as many of the following questions as possible so we can help you promptly! If you don’t know how to answer or it does not apply, feel free to remove it or leave it blank.

Builder content link
e.g. Builder.io: Visual Development Platform

Builder public api key
go to Builder.io: Visual Development Platform and copy your PUBLIC api key

What are you trying to accomplish
e.g. I want to integrate builder on a landing page

Screenshots or video link
Screenshots of your issue, or even better a link to a video of what is happening or what you are trying to accomplish. We love using loom for that sort of thing

Code stack you are integrating Builder with
e.g. NextJS, react, Shopify

Reproducible code example
If you are having integration errors, please link to codesandbox or copy and paste your problematic code here. The more detail the better!

Hello @designintavo,

Welcome to the Builder.io forum!

From what you’ve described, we suspect the issue may be related to your integration setup. Specifically, you should not be using both @builder.io/react@8.2.6 and @builder.io/sdk-react in the same project, as this can lead to unexpected behavior.

To help us troubleshoot further, could you please:

  1. Share your current integration code.

  2. Provide the Builder content link where you are experiencing the issue.

This will give us better context and allow us to provide more targeted guidance.

Thank you!

Hello Manish,

Thank you for the warm welcome and for pointing me in the right direction.

I’ve confirmed that I was previously using both @[builder.io/react@8.2.6](http://builder.io/react@8.2.6) and @[builder.io/sdk-react](http://builder.io/sdk-react), but I’ve since removed @[builder.io/sdk-react](http://builder.io/sdk-react) to avoid conflicts.

As for the integration code, could you clarify whether you’d like me to share the full project setup or just the key integration files (for example, the Builder init file, registry, and page components where BuilderComponent is rendered)? I want to make sure I provide the most relevant details without overwhelming you with the entire codebase.

Additionally, here is the Builder content link where I’m seeing the issue:

https://builder.io/content/b164126288994dd7b0502ed86177c014/edit?activeDesignerTab=0&activeLocale=Default

Thanks again for your help, and I’ll be happy to provide whichever parts of the integration code would be most useful for troubleshooting.

Best regards,
Sunita Negi

Hello @designintavo

Thank you for sharing the content link. After reviewing it, we believe the issue may be related to the model name identifier in your Builder integration code.

The content you shared is using the model name shadcn, while in your codebase the model name appears to be set as page. This mismatch could be the cause of the issue you’re experiencing.

export default async function Page(props: PageProps) {
  const model = "page"; // this should be "shadcn"
  const content = await builder
    .get(model, {
      userAttributes: {
        
        urlPath: "/" + (props?.params?.page?.join("/") || ""),
      },
      prerender: false,
    })
    .toPromise();

  return (
    <>
      {/* Render the Builder page */}
      <RenderBuilderContent content={content} model={model} />
    </>
  );
}

If you can share your page.tsx code, I’ll be able to review it in detail and provide you with the updated code including the fix.

Hi Manish,

I have changed the model name to page in builder.io, but it is still not working. As I have multiple page.tsx files, I am attaching my src folder for you to check.

Regards,
Sunita Negi

(Attachment src.zip is missing)

Hi Manish,

Not able to attach the file, so sharing google drive link with you

https://drive.google.com/file/d/1ybdJrZWsA0FNIDKL_Gyqx14meyQ9uZAx/view?usp=drive_link

Regards,
Sunita Negi

Hello @designintavo

Please accept my request to preview your google drive content.

Thanks,

I have approved your request

Hello @designintavo

Thank you for approving the request.

I’ve recorded a Loom video demonstrating the issue along with a possible solution:

Hope this helps! Let us know if you have any further questions.

Thanks,

Thanks Manish, I will check it out

Hi Manish,

Thanks for providing the demo. After reviewing it, I’ve noted that the video shows the application running on a local setup.

The issue I initially reported, however, appears to be exclusive to our production environment. My local version works fine, so I suspect the problem is tied to the production URL, which is: https://shadcn-builder-snowy.vercel.app/.

I’m available to collaborate on a joint debugging session if that’s a viable option for you.

Regards,
Sunita Negi

Hello @designintavo,

Can you share screen recording of the issue you are seeing production?

Hi Manish

I have attached the video recording, please check.

Regards,
Sunita Negi
Screen Recording 2025-08-20 at 12.39.57 PM.mov

Thank you! Please approve my request to preview it.

Approved, please check again.

Hello @designintavo

Thank you for sharing the screen recording. After reviewing it, I can confirm that the issue is related to the integration.

Please watch my Loom video again and carefully implement the solutions outlined there to ensure it works in production. Locally, Builder allows the editor to load content and edit even if there’s a model name mismatch in the integration. However, when you draft preview the page, you may not see any content as a result of this mismatch.

To resolve the issue, kindly follow the instructions from my video.

Best regards,

Thanks Manish, will check it out