Skip to content

useExtracted auto-generated message keys starting with / cause Google crawler 404 errors #2250

@coobeet

Description

@coobeet

Description

When using useExtracted with auto-generated message keys, some keys begin with the / character. Google's crawl bot interprets these as URL paths and attempts to crawl them, resulting in Not Found (404) errors reported in Google Search Console.

This is because the auto-generated key character set includes /, which is a valid URL path character. When these keys appear in the rendered HTML or page source, Googlebot treats them as relative URLs.

Screenshot from Google Search Console:

Image

Verifications

Mandatory reproduction URL

This issue is not reproducible in a code sandbox — it manifests in Google Search Console when Googlebot crawls a production site using useExtracted with auto-generated keys. The auto-generated keys (e.g. ones starting with /) appear in the page source and Googlebot interprets them as relative URL paths, then reports 404 errors.

Reproduction description

  1. Use useExtracted with auto-generated message keys in a Next.js app
  2. Deploy to production and let Google crawl the site
  3. Open Google Search Console → Pages → Not Found (404)
  4. Observe 404 entries corresponding to auto-generated message keys that start with /

Expected behaviour

Auto-generated message keys should not use characters that can be interpreted as URL paths by web crawlers. The character set should exclude URL-significant characters like /, ?, #, &.

Suggestion:

  • Use a character set for auto-generated keys that excludes URL-like characters, OR
  • Allow users to customize the character set / prefix used for auto-generated keys

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions