fix(seo-check): skip mock query on sitemap endpoints (unblocks sitemap 7.6 bump)#135
Merged
Merged
Conversation
@nuxtjs/sitemap >= 7.5 returns an empty 204 (and a meta-refresh instead of a 307 redirect) whenever a sitemap endpoint is requested with any query string. The SEO gate appended ?mockProductionEnv to every localhost request, which made the sitemap appear empty and failed the check after the sitemap dependency bump. The sitemap output is environment-independent, so the mock query is now skipped for sitemap URLs while robots.txt and page meta still exercise the production mock.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
launchpad | cff91d8 | Commit Preview URL Branch Preview URL |
May 16 2026, 10:43 AM |
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.
Problem
The Renovate PRs that bump @nuxtjs/sitemap to
7.6.0(#123) and @nuxtjs/seo to3.4.0(#122, which bundles sitemap 7.6.0) both fail the "Meta + sitemap + robots" CI gate.Root cause is a behaviour change in @nuxtjs/sitemap ≥ 7.5:
7.4.11: sitemap endpoints ignored query strings and returned content.7.6.0: any query string on a sitemap endpoint yields an empty HTTP 204 (?foo=bar→ 204, no query → 200), and/sitemap.xml?…answers with an HTML meta-refresh instead of a307redirect.scripts/seo-check.mjsappends?mockProductionEnvto every localhost request (to force the production robots/sitemap path out of the dev no-index lock). With 7.6.0 that query makes the sitemap look empty → 9 errors.Verified locally: the failure reproduces on both #123 (sitemap alone) and #122 (seo bundle); it is not a lockfile/flaky issue.
Fix
Skip the
?mockProductionEnvquery for sitemap URLs only (/sitemap*.xml,/sitemap_index.xml,/__sitemap__/*). The sitemap output is environment-independent here — verified the no-mock sitemap is fully populated (8 URLs per locale, correct redirect chain). robots.txt and page-meta checks still use the production mock, so coverage is unchanged.Validation
Ran the patched
scripts/seo-check.mjsagainst a local dev server built with @nuxtjs/sitemap 7.6.0:(Previously: 9 errors — empty sitemap + all indexable routes missing.)
Follow-up
Once this lands, #123 and #122 should be rebased and will pass the SEO gate. #116 (@nuxt/content) is unrelated and unaffected.
Test plan
Generated by Claude Code