nextjs - 💡(How to fix) Fix Support non-standard properties in `robots.ts` file [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#89519Fetched 2026-04-08 02:02:45
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
closed ×1commented ×1issue_type_added ×1labeled ×1

Error Message

// @ts-expect-error not a standard property I would expect this non-standard directive to still be propagated. Obviously, it does not make sense to include it in the types, so I’m fine with suppressing the error, but it should still propagate to robots.txt. It is very useful when Seznam bots crawl the site too aggressively.

Code Example

### Current vs. Expected behavior

I would expect this non-standard directive to still be propagated. Obviously, it does not make sense to include it in the types, so I’m fine with suppressing the error, but it should still propagate to robots.txt. It is very useful when Seznam bots crawl the site too aggressively.

At this point, I’m forced to create a static robots.txt file without using the TS version.

See: https://o-seznam.cz/napoveda/vyhledavani/en/crawling-control/#request-rate-directive

### Provide environment information
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

N/A

To Reproduce

  1. Create robots.txt file
  2. Put there this context and open localhost:3000/robots.txt you will see request rate directive is ignored

export default function robots(): MetadataRoute.Robots {
	const rules: MetadataRoute.Robots['rules'] = [
		{
			allow: '/',
			userAgent: '*',
		},
		{
			'allow': '/',
			// See: https://o-seznam.cz/napoveda/vyhledavani/en/crawling-control/#request-rate-directive
			// @ts-expect-error not a standard property
			'Request-Rate': '10/1m', // ~10k requests/day
			'userAgent': 'SeznamBot',
		},
	]

	return {
		rules,
	}
}

Current vs. Expected behavior

I would expect this non-standard directive to still be propagated. Obviously, it does not make sense to include it in the types, so I’m fine with suppressing the error, but it should still propagate to robots.txt. It is very useful when Seznam bots crawl the site too aggressively.

At this point, I’m forced to create a static robots.txt file without using the TS version.

See: https://o-seznam.cz/napoveda/vyhledavani/en/crawling-control/#request-rate-directive

Provide environment information

N/A

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

No response

extent analysis

TL;DR

The Request-Rate directive is being ignored in the generated robots.txt file, likely due to it being a non-standard property.

Guidance

  • The issue is likely caused by Next.js not supporting the non-standard Request-Rate property in the MetadataRoute.Robots type.
  • To verify, check the generated robots.txt file to see if the Request-Rate directive is present.
  • As a workaround, consider creating a custom robots.txt file with the desired Request-Rate directive, rather than relying on the MetadataRoute.Robots type.
  • Alternatively, try using a different property name or syntax to see if Next.js will propagate the directive to the robots.txt file.

Example

// Example of a custom robots.txt file with the Request-Rate directive
// User-agent: SeznamBot
// Allow: /
// Request-Rate: 10/1m

Notes

The Request-Rate directive is not a standard property in the robots.txt specification, so it's unclear whether Next.js will ever support it. The workaround of creating a custom robots.txt file may be the most reliable solution.

Recommendation

Apply workaround: Create a custom robots.txt file with the desired Request-Rate directive, as this allows for more control over the file's contents and avoids relying on Next.js to support a non-standard property.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING