I run TechTweak, a site with specs, prices and side-by-side comparisons for around 600 smartphones. It is a fairly ordinary stack: Next.js (App Router) on Vercel, MongoDB through Mongoose, images on Cloudinary, and articles written in Markdown.

For months it looked healthy. Builds passed, pages loaded, there were no errors in the logs. Then I spent a few weeks going through Google Search Console reports and checking pages one by one, and I found a set of bugs that had one thing in common: none of them ever threw an error. They just produced slightly wrong output, quietly, at scale.

If you run a content-heavy site, there is a good chance you have at least one of these.

1. A comma inside a URL broke every single image save

Symptom: I added photos to a phone in the admin panel, and the page still showed no image. Adding more photos did not help.

Cause: The admin form sends image URLs as one string. The uploader joined them with|, but the save action had a fallback for older data:

const images = imagesRaw.includes("|") ? imagesRaw.split("|") : imagesRaw.split(","); 

That looks harmless until you remember that Cloudinary URLs contain commas: .../image/upload/f_auto,q_auto/v1793364090/.... With two or more images the string contained a |, so everything worked. With exactly one image there was no |, so the code split on the comma inside the URL and saved two broken fragments. The first fragment became the phone's main image.

Fix: Only treat a comma as a separator when a new URL follows it:

const parseImageList = (raw: string | null) => (raw || "") .split(/\||,(?=\s*(?:https?:\/\/|\/))/) .map((s) => s.trim()) .filter(Boolean); 

A one-off script then found and rejoined the fragments. Seven phones had been affected.

Lesson: Any delimiter you choose must not be able to appear inside the values. URLs are a minefield: commas, semicolons, even | are all legal in some form.

2. Mixed data types made new phones sort last

Symptom: "Newest first" lists showed the Galaxy S20 before the Galaxy S26.

Cause: Most documents stored release_date_parsed as a real Date, but 25 phones, imported by an old script that bypassed Mongoose, stored it as an ISO string. MongoDB sorts by BSON type before value, and a Date sorts after a String. So in a descending sort every real date came first, and every phone with a string date, including the newest flagships, sank to the bottom.

Fix: A quick aggregation showed the problem immediately:

db.phones.aggregate([ { $group: { _id: { $type: "$release_date_parsed" }, n: { $sum: 1 } } } ]); // [{ _id: "date", n: 582 }, { _id: "string", n: 25 }, { _id: "null", n: 2 }] 

Converting the 25 strings to dates fixed the sort everywhere at once.

Lesson: A schema in your ORM does not protect data written around it. Run $type checks on fields you sort or filter by.

3. Markdown tables were rendering as raw pipes

Symptom: Comparison tables in articles appeared on the live site as plain text: | Storage | US | Canada |.

Cause: react-markdown follows CommonMark, and tables are not part of CommonMark. They come from GitHub Flavored Markdown, which needs a plugin. Without it there is no error, just text.

Fix:

import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; <ReactMarkdown remarkPlugins={[remarkGfm]}>{content}</ReactMarkdown> 

I also wrapped tables in a horizontally scrollable container, because wide spec tables overflow on phones.

Lesson: Look at the rendered page, not the source. Every article had looked fine in the editor's preview, which used a different renderer.

4. Old URLs kept outranking their own replacements

Symptom: Search Console listed real phone pages as "Duplicate without user-selected canonical", even though each one had a correct canonical tag.

Cause: Early on, phones without a brand were published at /phones/unknown/<slug>. Those URLs were later fixed and given permanent redirects. But Google had already indexed them, and it had not recrawled them since the redirects were added. As far as Google knew, the old URLs were still live pages, so it treated them as the originals and the new pages as duplicates. The URL Inspection API confirmed it: for the real page, googleCanonical pointed at the old /unknown/ URL.

Fix: Search Analytics data showed 232 old URLs still getting impressions. I put them in a temporary sitemap:

// app/sitemap-legacy.xml/route.ts const xml = LEGACY_REDIRECT_PATHS.map( (path) => `<url><loc>${baseUrl}${path}</loc><lastmod>2026-10-23</lastmod></url>` ).join(""); 

Listing URLs that redirect is normally something to avoid, but used briefly it tells Google to recrawl them, see the 308, and move the signals to the new pages. Once Search Console stops reporting them, the sitemap gets deleted.

Lesson: A redirect only helps once Google has seen it. For URLs Google already trusts, give it a reason to come back.

5. Structured data that Google silently discarded

Symptom: An email from Search Console: Either "offers", "review", or "aggregateRating" should be specified.

Cause: Every phone page emitted Product JSON-LD with name, brand, image and description, but no price, because the site does not sell anything. Google's rules for product snippets require at least one of offers, review or aggregate rating. Without one, the whole block is invalid.

Fix: Phones with an official US list price now include it as an offer, because that price is already shown on the page. Phones whose price is only a currency conversion no longer emit Product markup at all, since a converted figure is not a real offer:

const offer = usListPriceOffer(phone.price_usd, brandSlug, phone.us_available, phone.price_status); if (offer) jsonLd.push({ "@type": "Product", /* ... */, offers: { ...offer, url } }); 

Lesson: Invalid structured data does not stop a page from being indexed, but it is simply ignored. Run your templates through Google's Rich Results Test, not just a JSON validator.

6. The free image quota ran out, and new images got HTTP 402

Symptom: New article thumbnails and newly uploaded phone photos stopped appearing. Older images still worked fine.

Cause: Every image went through next/image, which uses Vercel's image optimizer. On the free plan the number of source images that can be optimized each month is limited. Once the limit was reached, every uncached image request returned:

402 Payment Required OPTIMIZED_IMAGE_REQUEST_PAYMENT_REQUIRED 

Cached images kept working, which is exactly what made it confusing: the site looked fine unless you looked at something new.

Fix: Most images already lived on Cloudinary, which can resize and convert formats itself. A custom loader hands that work to Cloudinary and serves local files as they are:

// src/lib/imageLoader.ts export default function imageLoader({ src, width }: { src: string; width: number }) { const marker = "/image/upload/"; const i = src.indexOf(marker); if (src.includes("res.cloudinary.com") && i !== -1) { const rest = src.slice(i + marker.length).replace(/^f_auto,q_auto\//, ""); return `${src.slice(0, i + marker.length)}w_${width},c_limit,q_auto,f_auto/${rest}`; } return src.startsWith("/") ? `${src}?w=${width}` : src; } 
// next.config.ts images: { loader: "custom", loaderFile: "./src/lib/imageLoader.ts" } 

Lesson: If your images already sit on a CDN that can transform them, you may not need a second optimizer in front of it.

A bonus: logic that read "unknown" as "no"

A smaller pattern showed up in several places. A spec checklist showed a red cross next to "Wi-Fi 6/7 Ready" for 241 phones that do support Wi-Fi 6 or 7, because the check looked for the exact string "wi-fi 7" while the data said 802.11 a/b/g/n/ac/6e/7. A "charger in the box" field defaulted to true, so phones that ship without a charger claimed to include one. And unreleased phones showed red crosses for NFC simply because nobody knew yet.

In each case the fix was the same: treat "not known" as its own state, rather than letting it fall through to "no" or "yes."

What I would do from day one

  1. Audit with real data, not just builds. Search Console's URL Inspection and Search Analytics APIs found problems no test would have caught.
  2. Check types in the database, not only in your schema.
  3. Render and look at real pages on a phone screen, including tables and images.
  4. Store unknown values as null, and design the UI to say "not specified."
  5. Know your platform's free-tier limits before they become an outage.

None of these bugs were hard to fix. They were hard to notice, because everything kept returning 200 OK.