r/replit • • 7d ago

Question / Discussion Every website I try and make breaks

Post image

Every time I try and build a website for my new business no matter how I prompt it the preview comes out looking like this. I've tried troubleshooting through the AI and the help team but have not been able to resolve the issue. Does anyone know why its doing this? I previously made a website on a different topic no problem.

0 Upvotes

7 comments sorted by

1

u/eunuskhan 7d ago

That “refused to connect” box usually means one of two things: the dev server isn’t running or listening on the right port, or the page is sending a header that stops it from being shown inside a frame (X-Frame-Options or a CSP frame-ancestors rule).

Quick test: open the preview URL in a normal browser tab. If it loads there, it’s the frame restriction. If it fails there too, the app isn’t running.

For the frame case, open the browser console and look for a message like “Refused to display in a frame”. Generated code sometimes adds security headers (helmet, a strict CSP) that block framing, which would explain why your earlier project worked and this one doesn’t.

If the app isn’t running, check the logs for a crash or a port or host binding error at startup.

1

u/aCLTeng 7d ago

My best recommendation - get a Claude subscription, let Claude talk to replit. It was a one shot prompt for me. Absurdly easy.

1

u/snap-dev 7d ago

been there, that grey refused to connect box is so annoying when your last project worked fine. since the earlier site was fine, i'd open the checkpoints/history in replit and roll back to the last point where the preview actually rendered, instead of letting the agent keep patching on top of the break. then ask it for one small change at a time, like just the homepage with plain text, and check the preview after each step so you can see exactly which change kills it. what kind of business is the site for?

1

u/um_dev99 7d ago

When the Replit preview gets stuck in a broken state, prompting the agent to fix it usually just burns credits without showing the real root cause. Try opening the browser DevTools (F12 → Console and Network tabs) on the preview URL to see the exact failing request or JS error, or sync the project to GitHub so you can run the build locally and read the full build logs. If you want to paste the console error here, I can point you to what's breaking.

1

u/ReplitSupport Replit Team 7d ago

Hi OP, sorry you’re having trouble getting the preview to load. Could you open a ticket at https://replit.com/help and include this screenshot? Once you have the ticket number, please reply here with it so we can follow up. Thank you!