
Quick context: HelloVacancy is built on Lovable, with Supabase as the backend. Mentioning that upfront because it matters for what broke.
We let companies share their job posts and company pages. Should be simple: someone posts a link on LinkedIn or in a Slack channel, and it shows a nice preview with the actual job title and company name.
Instead, it just showed our homepage. Every time. Didn't matter which job, which company, which page. Same generic preview no matter what got shared. Checked it in the Facebook Sharing Debugger and yeah, it was pulling the default homepage meta tags every single time.
Makes sense once you think about it. The app is a single-page app. A social bot hits the URL, doesn't run any JavaScript, and just sees whatever's sitting in the base HTML. Which is the homepage stuff. Doesn't matter that the real page has different content: the bot never actually sees it.
First thing we tried: a Cloudflare Worker sitting in front of the site. It checks the request's user agent, and if it looks like a known bot: Facebook's, Twitter's, LinkedIn's, Slack's, WhatsApp's, a few others: it doesn't send them the normal app. Instead, it proxies that one request to a Supabase edge function that renders the real meta tags for that specific job or company page, and sends that back instead. Regular visitors never touch this; they just get the app like normal.
Honestly, kind of proud of that fix when we shipped it. It worked... mostly.
Just not consistently. We'd fix a share, test it in the debugger, it'd look fine. Then a few days later, the same link would go back to showing the default homepage again. Never fully nailed down why. Maybe a bot with a slightly different user agent that wasn't on our list. Maybe the edge function was slow sometimes and something timed out. Maybe Facebook was just caching an old result. Tried a few things, but it never felt fully solid, so we stopped trying to make it solid and looked at a different fix instead.
What we ended up doing: moved the hosting off Lovable's default host and onto Vercel, pulling from the GitHub repo Lovable pushes to. Lovable's still where we build the app day to day. Supabase's still the backend. Just the hosting layer changed. Vercel handles per-page rendering properly, so the bot problem mostly went away without needing to keep guessing at user agents.
Not sure if this is the "correct" way to solve this or if we just found the path of least resistance. If anyone's run into the same thing on a Lovable + Supabase stack: did you patch it with a worker like we did, or did you also end up switching hosting? Curious if there's a cleaner way we missed.
The OG/crawler angle is easy to miss on SPA stacks. One thing that helped me: treat social scrapers as a separate client ? Facebook/LinkedIn/Slack bots often ignore client-rendered meta. Serving a minimal server (or edge) response with title/description/image for bot user-agents, while keeping the Lovable/Supabase app for humans, usually fixes previews without rewriting the whole app. Worth checking what your hosting actually returns to curl -A facebookexternalhit vs a normal browser.
Yeah, that's the exact bug, bots don't run JS, so they just see the homepage HTML.
We tried that too (worker + edge function for bot UAs). Worked for a few days, then quietly broke again & never nailed down why. Ended up just moving hosting to Vercel instead, way less maintenance than chasing a UA list.