fix(seo): getSiteSeo falls back to lowercase "site" key - #479
Merged
Merged
Conversation
The decofile block key for the site config is "site" (lowercase) in
sites migrated from Fresh/Preact/Deno. getSiteSeo() and the inline
equivalent in workerEntry.ts only looked up blocks["Site"] (capital S),
silently returning {} and zeroing out the global SEO fallback (title,
og:image, og:site_name, etc.) on every page.
Fix: try blocks["Site"] first (keeps backward compat with sites that use
the capital key), then fall back to blocks["site"].
Reported by: deco-sites/oficina-tanstack#59
JonasJesus42
approved these changes
Aug 20, 2026
|
🎉 This PR is included in version 7.48.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema
getSiteSeo()empackages/blocks/src/cms/loader.tse o bloco equivalente emworkerEntry.tsfazem lookup deblocks["Site"](S maiúsculo). Em sites migrados do Fresh/Preact/Deno, o block key do site é"site"(minúsculo) — causando retorno silencioso de{}e zerando o SEO global (title,og:image,og:site_name, etc.) em todas as páginas.Reportado em deco-sites/oficina-tanstack#59.
Fix
Tenta
blocks["Site"]primeiro (backward compat com sites que usam a chave maiúscula), depoisblocks["site"]:Arquivos alterados:
packages/blocks/src/cms/loader.ts—getSiteSeo()packages/tanstack/src/sdk/workerEntry.ts— bloco inline equivalenteCompatibilidade
"Site"(maiúsculo): comportamento idêntico,blocks["Site"]ainda retorna primeiro"site"(minúsculo): agora encontram o bloco corretamente{}como antes🤖 Generated with Claude Code
Summary by cubic
Fixes global SEO defaults by resolving the site block with a fallback to lowercase. Previously
getSiteSeoand the worker only readblocks["Site"], returning {} on migrated projects and wiping site-wide SEO; now they tryblocks["Site"]and thenblocks["site"].packages/blocks/src/cms/loader.ts(getSiteSeo) andpackages/tanstack/src/sdk/workerEntry.ts(worker SEO merge).Written for commit 7fa67cb. Summary will update on new commits.