Skip to content

Upgrading @nuxtjs/robots 6 to 7

Breaking6.2.4 → 7.0.2Breaking13Platform1New6Changed2Fixed19

BreakingUpgrade verdict

13 breaking changes and a platform requirement change.

  • This version only works with newer Nuxt releases; projects on Nuxt 3 must upgrade Nuxt first.
  • On Nuxt 4, move robots.txt files from assets/ and pages/ into app/assets/ or app/pages/.
  • Nuxt Content v2 is no longer supported; you need Nuxt Content v3.
  • Site Config is upgraded to v5, which changes how build time configuration is prioritized.
Top 4 of 14 that need code or config changes

@nuxtjs/robots publishes an official migration guide for version 7. It covers more than the release notes do.

V5 to v6 migration guide ↗

Requires Node.js ^22.22.3 || ^24.15.0 || >=26.0.0 from 7.0.0 (none stated before).

Adds @vueuse/core ^15.0.0.

Drops h3, pathe, pkg-types.

Installs 35 packages in all (was 53).

Also installs @types/web-bluetooth, @vueuse/metadata, @vueuse/shared.

No longer installs @clack/core, @clack/prompts, @nuxt/devtools-kit, @polka/url, birpc, citty, confbox, cookie-es, crossws, fast-string-truncated-width, fast-string-width, fast-wrap-ansi, iron-webcrypto, mrmime, node-mock-http and 5 more.

Moves nuxt-site-config 4.2.3 → 5.0.3, nuxt-site-config-kit 4.2.3 → 5.0.3, nuxtseo-shared 5.3.16 → 6.0.3, site-config-stack 4.2.3 → 5.0.3. Your build may pick other versions.

Breaking13
Requires Nuxt ^4.6.0 || ^5.0.0 and removes Nuxt 3 support.
Custom robots.txt files in assets/ and pages/ are now read from srcDir, which defaults to app/ on Nuxt 4.
srcDir
Drops Nuxt Content v2 support.
Loads Nuxt Site Config >=5.0.0 as a module dependency, changing build time config priority.
Nuxt Content integration now requires Nuxt Content v3; v2 projects fail at startup.
defineRobotsSchema()
Server functions move to #robots/server and app composables to #robots/app; internal aliases are removed.
#robots/server#robots/app#internal/nuxt-robots#internal/nuxt-simple-robotsgetBotDetection()
Server functions and Nitro hook contexts now use the RequestEvent type from nuxt/server.
RequestEventgetSiteRobotConfig()getPathRobotConfig()getBotDetection()isBot()getBotInfo()robots:configrobots:robots-txt
robots:config hook edits using ctx.event now affect only that request's robots.txt response.
robots:configsite-config:initgetNitroOrigin()
useRobotsRule(true) now sends robotsDisabledValue when Site Config disables indexing, and null keeps the existing rule.
useRobotsRule()robotsDisabledValuerobotsEnabledValue
Route rules now take precedence over definePageMeta({ robots }) when both match a path.
definePageMeta()
The optional zod peer dependency is now ^4.6.5 for defineRobotsSchema().
defineRobotsSchema()zod
The Robots DevTools panel now requires nuxtseo-devtools-host as a dev dependency.
nuxtseo-devtools-host
Requires Nuxt 4.6 and native request APIs.
Platform1
Requires Node ^22.22.3 || ^24.15.0 || >=26.0.0.

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • changed: const defineRobotsSchema: (options?: nuxtseo_shared_content.ContentSchemaOptions | undefined) => z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>> → const defineRobotsSchema: (options?: nuxtseo_shared_content.ContentSchemaOptions | undefined) => z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>
  • changed: const schema: z.ZodObject<{ [x: string]: any }, z.core.$strip, z.ZodTypeAny, { [x: string]: any }, { [x: string]: any }> → const schema: z.ZodObject<{ [x: string]: any }, z.core.$strip>
  • changed: property ModuleOptions.blockAiBots: boolean → property ModuleOptions.blockAiBots: boolean | 'training'
  • added: export { useBotDetection } from '../../composables/mock'
  • added: export { ReactiveRobotsValue } from '../../composables/useRobotsRule'
  • added: export { useRobotsRule } from '../../composables/useRobotsRule'
  • added: export { BotInfo } from '../../types'
  • added: export { ReactiveRobotsValue } from '../composables/useRobotsRule'
  • added: export { RobotsValue } from '../../types'
  • added: export { UseBotDetectionOptions } from '../../types'
  • added: export { UseBotDetectionReturn } from '../../types'
  • added: export { useBotDetection } from '../composables/mock'
  • added: export { useRobotsRule } from '../composables/useRobotsRule'
  • changed: function useRobotsRule(rule?: MaybeRef<boolean | string>): import('vue').Ref<string, string> → function useRobotsRule(rule?: ReactiveRobotsValue): import('vue').Ref<string, string>
  • added: export { useBotDetection } from '../../composables/mock'
  • added: export { ReactiveRobotsValue } from '../../composables/useRobotsRule'
  • added: export { useRobotsRule } from '../../composables/mock'
  • added: export { BotInfo } from '../../types'
  • added: export { ReactiveRobotsValue } from '../composables/useRobotsRule'
  • added: export { RobotsValue } from '../../types'
  • added: export { UseBotDetectionOptions } from '../../types'
  • added: export { UseBotDetectionReturn } from '../../types'
  • added: export { useBotDetection } from '../composables/mock'
  • added: export { useRobotsRule } from '../composables/mock'
  • added: export { BotInfo } from '../types'
  • added: export { ReactiveRobotsValue } from './composables/useRobotsRule'
  • added: export { RobotsValue } from '../types'
  • added: export { UseBotDetectionOptions } from '../types'
  • added: export { UseBotDetectionReturn } from '../types'
  • added: export { useBotDetection } from './composables/useBotDetection'
  • added: export { useRobotsRule } from './composables/useRobotsRule'
  • added: export { getBotDetection } from '../../mock-composables'
  • added: export { getBotInfo } from '../../mock-composables'
  • added: export { isBot } from '../../mock-composables'
  • added: export { getPathRobotConfig } from '../../composables/getPathRobotConfig'
  • added: export { getSiteRobotConfig } from '../../composables/getSiteRobotConfig'
  • added: export { BotDetectionContext } from '../../types'
  • added: export { BotInfo } from '../../types'
  • added: export { RobotsContext } from '../../types'
  • added: export { getBotDetection } from '../mock-composables'
  • added: export { getBotInfo } from '../mock-composables'
  • added: export { getPathRobotConfig } from '../composables/getPathRobotConfig'
  • added: export { getSiteRobotConfig } from '../composables/getSiteRobotConfig'
  • added: export { isBot } from '../mock-composables'
  • changed: function getBotDetection(event: H3Event): any → function getBotDetection(event: RequestEvent): any
  • changed: function getBotInfo(event: H3Event): any → function getBotInfo(event: RequestEvent): any
  • changed: function isBot(event: H3Event): boolean → function isBot(event: RequestEvent): boolean
  • changed: function getPathRobotConfig(e: H3Event, options?: { userAgent?: string; skipSiteIndexable?: boolean; path?: string }): RobotsContext → function getPathRobotConfig(e: RequestEvent, options?: { userAgent?: string; skipSiteIndexable?: boolean; path?: string }): RobotsContext
  • changed: function getSiteRobotConfig(e: H3Event): { indexable: boolean; hints: string[] } → function getSiteRobotConfig(e: RequestEvent): { indexable: boolean; hints: string[] }
  • changed: function useRuntimeConfigNuxtRobots(event?: H3Event): NuxtRobotsRuntimeConfig → function useRuntimeConfigNuxtRobots(_event?: Pick<RequestEvent, 'context'>): NuxtRobotsRuntimeConfig
  • added: export { getBotDetection } from '../../mock-composables'
  • added: export { getBotInfo } from '../../mock-composables'
  • added: export { isBot } from '../../mock-composables'
  • added: export { getPathRobotConfig } from '../../mock-composables'
  • added: export { getSiteRobotConfig } from '../../mock-composables'
  • added: export { BotDetectionContext } from '../../types'
  • added: export { BotInfo } from '../../types'
  • added: export { RobotsContext } from '../../types'
  • added: export { getBotDetection } from '../mock-composables'
  • added: export { getBotInfo } from '../mock-composables'
  • added: export { getPathRobotConfig } from '../mock-composables'
  • added: export { getSiteRobotConfig } from '../mock-composables'
  • added: export { isBot } from '../mock-composables'
  • added: export { BotDetectionContext } from '../types'
  • added: export { BotInfo } from '../types'
  • added: export { RobotsContext } from '../types'
  • added: export { getBotDetection } from './composables/getBotDetection'
  • added: export { getBotInfo } from './composables/getBotDetection'
  • added: export { getPathRobotConfig } from './composables/getPathRobotConfig'
  • added: export { getSiteRobotConfig } from './composables/getSiteRobotConfig'
  • added: export { isBot } from './composables/getBotDetection'
  • changed: const _default: any → const _default: import('nuxt/server').EventHandler<Promise<void>>
  • changed: function getBotDetection(e: H3Event): BotDetectionContext → function getBotDetection(e: RequestEvent): BotDetectionContext
  • changed: function getBotInfo(e: H3Event): null → function getBotInfo(e: RequestEvent): null
  • changed: function getPathRobotConfig(e: H3Event, options?: { skipSiteIndexable?: boolean; path?: string }): { indexable: boolean; rule: string } → function getPathRobotConfig(e: RequestEvent, options?: { userAgent?: string; skipSiteIndexable?: boolean; path?: string }): { indexable: boolean; rule: string }
  • changed: function getSiteRobotConfig(e: H3Event): { indexable: boolean; hints: string[] } → function getSiteRobotConfig(e: RequestEvent): { indexable: boolean; hints: string[] }
  • changed: function isBot(e: H3Event): boolean → function isBot(e: RequestEvent): boolean
  • changed: const _default: any → const _default: import('nuxt/server').EventHandler<Promise<{ robotsTxt: string; indexable: boolean; hints: string[]; runtimeConfig: import('../../../types.js').NuxtRobotsRunti…
  • changed: const _default: any → const _default: import('nuxt/server').EventHandler<Promise<{ rule: string; indexable: boolean; crawlable: boolean; path: string; debug: { source: string | null; line: string |…
  • changed: const _default: any → const _default: import('nuxt/server').EventHandler<Promise<ProductionDebugResponse>>
  • removed: const _default: any
  • removed: default _default
  • changed: const _default: any → const _default: import('nuxt/server').EventHandler<Promise<string>>
  • changed: function resolveRobotsTxtContext(e: H3Event | undefined, nitro?: NitroApp): Promise<HookRobotsConfigContext<H3Event>> → function resolveRobotsTxtContext(e: RequestEvent | undefined, nitro?: NitroApp): Promise<HookRobotsConfigContext<RequestEvent>>
  • added: function withoutLocalePrefix(path: string, publicRuntimeConfig: Record<string, unknown>): string
  • removed: property NuxtRobotsRuntimeConfig.isNuxtContentV2: boolean
  • removed: property NuxtRobotsRuntimeConfig.pageMetaRobots: Record<string, RobotsValue>
  • changed: interface HookRobotsConfigContext<Event = H3Event> extends ParsedRobotsTxt → interface HookRobotsConfigContext<Event = RequestEvent> extends ParsedRobotsTxt
  • changed: interface HookRobotsTxtContext<Event = H3Event> → interface HookRobotsTxtContext<Event = RequestEvent>
  • changed: function getBotDetection(headers: Record<string, string | string[] | undefined>, patternMap?: Map<string, PatternMapValue>): BotDetectionContext → function getBotDetection(headers: Headers | Record<string, string | string[] | undefined>, patternMap?: Map<string, PatternMapValue>): BotDetectionContext
  • changed: function isBotFromHeaders(headers: Record<string, string | string[] | undefined>, patternMap?: Map<string, PatternMapValue>): { isBot: boolean; data?: { botName: BotName; botCategory: BotCategory; trusted: boolean } } → function isBotFromHeaders(headers: Headers | Record<string, string | string[] | undefined>, patternMap?: Map<string, PatternMapValue>): { isBot: boolean; data?: { botName: BotName; botCategory: BotCategory; trusted: boolean } }