Skip to content

fix(components): return 404 for unknown component libraries - #752

Draft
dgaponov wants to merge 1 commit into
mainfrom
seo/components-soft-404
Draft

fix(components): return 404 for unknown component libraries#752
dgaponov wants to merge 1 commit into
mainfrom
seo/components-soft-404

Conversation

@dgaponov

@dgaponov dgaponov commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

/components/<что угодно> отдавал 200 с пустой оболочкой — неограниченное число несуществующих URL было индексируемыми soft 404. При этом /<чушь> и /components/uikit/<чушь> уже корректно отдавали 404.

Добавлена проверка libId по libs в getServerSideProps — ровно та же, что уже есть в src/pages/design/[sectionId]/index.tsx.

/components и /components/uikit намеренно оставлены как есть: эти URL должны ранжироваться, им нужен контент, а не редирект.

Проверено: 404 в en/ru/es, остальные страницы 200, скан всех URL sitemap без новых падений.

🤖 Generated with Claude Code

/components/<anything> rendered an empty shell with HTTP 200, so an
unlimited number of non-existent URLs were indexable soft 404s. Other bad
paths behaved correctly: /<nonsense> and /components/uikit/<nonsense>
already returned 404.

Guard getServerSideProps with a lookup against `libs`, mirroring the
existing check in src/pages/design/[sectionId]/index.tsx, where this
pattern was already applied.

Scope is limited to the soft-404 surface. /components and
/components/uikit still render a client-redirect stub; giving them real
content is tracked separately, so they are deliberately not turned into
redirects here.

Verified in dev and in a production build: unknown libs return the real
404 page in en/ru/es, valid library, component, design and landing pages
still return 200, and a scan of all 160 sitemap URLs shows no new
failures. Build, lint and typecheck pass. E2E not run — Playwright
browsers are not installed locally.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant