Skip to content

Upgrading @nuxtjs/robots 5 to 6

Breaking5.7.1 → 6.2.4Breaking2Deprecated1New6Changed2Fixed20Other1

BreakingUpgrade verdict

2 breaking changes.

  • If you write custom code that inspects the robots config hook, there is a new warnings list next to the errors list.
  • An internal helper module was upgraded to a new major version. Your site is probably unaffected, but you may want to review its breaking changes.
  • The old helper for adding robots fields to content is deprecated; use the new one instead.
3 items need code or config changes

Adds nuxtseo-shared ^5.3.16.

Drops @nuxt/devtools-kit, sirv, std-env.

Installs 53 packages in all (was 58).

Breaking2
The robots:config hook context now includes a warnings: string[] field alongside errors.
HookRobotsConfigContextrobots:configwarningserrors
Updates the internal Nuxt Site Config module to v4.0.0, which may include breaking changes.
Deprecated1
Deprecates the asRobotsCollection() helper in favor of defineRobotsSchema().
asRobotsCollectiondefineRobotsSchema

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

  • changed: const schema: z.ZodObject<{ robots: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>> }, z.core.$strip> → const schema: z.ZodObject<{ [x: string]: any }, z.core.$strip, z.ZodTypeAny, { [x: string]: any }, { [x: string]: any }>
  • added: const defineRobotsSchema: (options?: nuxtseo_shared_content.ContentSchemaOptions | undefined) => z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>
  • added: export { RobotsRouteRuleConfig } from '../dist/runtime/types'
  • removed: const _default: import('nuxt/app').Plugin<Record<string, unknown>> & import('nuxt/app').ObjectPlugin<Record<string, unknown>>
  • removed: default _default
  • removed: function createNitroRouteRuleMatcher(e?: H3Event): (path: string) => NitroRouteConfig
  • removed: function withoutQuery(path: string): string | undefined
  • changed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<void>> → const _default: any
  • changed: const _default: import('nitropack/types').NitroAppPlugin → const _default: any
  • changed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ robotsTxt: unknown; indexable: boolean; hints: string[]; runtimeConfig: import('../../../… → const _default: any
  • changed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ rule: string; indexable: boolean; crawlable: boolean; path: string; debug: { source: stri… → const _default: any
  • added: const _default: any
  • added: default _default
  • added: interface ProductionDebugResponse
  • added: property ProductionDebugResponse.error?: string
  • added: property ProductionDebugResponse.hasRemoteDebug: boolean
  • added: property ProductionDebugResponse.hints: string[]
  • added: property ProductionDebugResponse.indexable: boolean
  • added: property ProductionDebugResponse.robotsTxt: string
  • added: property ProductionDebugResponse.url: string
  • added: property ProductionDebugResponse.validation: { errors: string[]; warnings: string[]; groups: number; sitemaps: string[] }
  • changed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<any[]>> → const _default: any
  • changed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<string>> → const _default: any
  • changed: function resolveRobotsTxtContext(e: H3Event | undefined, nitro?: NitroApp): Promise<HookRobotsConfigContext> → function resolveRobotsTxtContext(e: H3Event | undefined, nitro?: NitroApp): Promise<HookRobotsConfigContext<H3Event>>
  • added: function extractRobotsMetaFromHtml(html: string): { content: string | null; productionContent: string | null; hint: string | null } | null
  • changed: interface HookRobotsConfigContext extends ParsedRobotsTxt → interface HookRobotsConfigContext<Event = H3Event> extends ParsedRobotsTxt
  • changed: interface HookRobotsTxtContext → interface HookRobotsTxtContext<Event = H3Event>
  • changed: property BotInfo.method?: 'server' | 'fingerprint' → property BotInfo.method?: 'headers' | 'fingerprint'
  • changed: property HookRobotsConfigContext.event?: H3Event → property HookRobotsConfigContext.event?: Event
  • changed: property HookRobotsTxtContext.e: H3Event → property HookRobotsTxtContext.e: Event
  • changed: type NormalisedLocales = { code: string; iso?: string; domain?: string }[] → type NormalisedLocales = { code: string; iso?: string; domain?: string; domains?: string[]; defaultForDomains?: string[] }[]
  • added: interface RobotsRouteRuleConfig
  • added: property AutoI18nConfig.multiDomainLocales?: boolean
  • added: property ParsedRobotsTxt.warnings: string[]
  • added: property RobotsRouteRuleConfig.robots?: RobotsValue | { indexable?: boolean; rule?: string }
  • added: export { RobotsRouteRuleConfig } from '../dist/runtime/types'
  • changed: function normaliseRobotsRouteRule(config: NitroRouteConfig): { allow: boolean | undefined; rule: string | undefined } | undefined → function normaliseRobotsRouteRule(config: RobotsRouteRuleConfig | undefined | null): { allow: boolean | undefined; rule: string | undefined } | undefined
  • added: function isNoIndexRule(rule: string): boolean
  • added: function robotsDirectivesFromObject(obj: Record<string, any>): string[]