From 880f9a4cf0b70b4efa0ecb313f14663e2f02983a Mon Sep 17 00:00:00 2001 From: "posthog[bot]" <206114724+posthog[bot]@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:14:40 +0000 Subject: [PATCH] fix(seo): wrap home page JSON-LD in @graph with top-level @context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The home page injected its JSON-LD as a bare top-level array (`[organizationJsonLd, productJsonLd, faqJsonLd]`). Each object carried its own `@context`, but the array itself had none, so consumers that treat the parsed JSON-LD as a single object read `r["@context"]` → `undefined` and crashed calling `.toLowerCase()` on it. Error tracking captured an unhandled `TypeError: undefined is not an object (evaluating 'r["@context"].toLowerCase')` from an injected structured-data reader on amend.sh. Wrap the three entities in a single `@graph` with one top-level `@context` and drop the now-redundant per-object `@context`. This fixes the crash trigger and produces a more standard structured-data shape. Resolves PostHog inbox report 019ec185-73e0-7f4a-a0cf-26b2dfa5d321. Generated-By: PostHog Code Task-Id: 38c8d80f-f631-448e-a9d6-88d20c7dd846 --- apps/web/src/lib/seo.ts | 3 --- apps/web/src/routes/index.tsx | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/src/lib/seo.ts b/apps/web/src/lib/seo.ts index 5f6a459..681bbad 100644 --- a/apps/web/src/lib/seo.ts +++ b/apps/web/src/lib/seo.ts @@ -54,7 +54,6 @@ export function openGraphMeta({ export const noIndexMeta = [{ name: "robots", content: "noindex, nofollow" }] as const; export const faqJsonLd = { - "@context": "https://schema.org", "@type": "FAQPage", mainEntity: [ { @@ -101,7 +100,6 @@ export const faqJsonLd = { }; export const productJsonLd = { - "@context": "https://schema.org", "@type": "SoftwareApplication", name: "Amend.sh", applicationCategory: "BusinessApplication", @@ -154,7 +152,6 @@ export const productJsonLd = { }; export const organizationJsonLd = { - "@context": "https://schema.org", "@type": "Organization", name: "Amend.sh", url: siteUrl, diff --git a/apps/web/src/routes/index.tsx b/apps/web/src/routes/index.tsx index 55a47f9..c0442e3 100644 --- a/apps/web/src/routes/index.tsx +++ b/apps/web/src/routes/index.tsx @@ -56,7 +56,10 @@ function HomeComponent() { type="application/ld+json" suppressHydrationWarning dangerouslySetInnerHTML={{ - __html: JSON.stringify([organizationJsonLd, productJsonLd, faqJsonLd]), + __html: JSON.stringify({ + "@context": "https://schema.org", + "@graph": [organizationJsonLd, productJsonLd, faqJsonLd], + }), }} />