跳到主要内容

NUXT_B5001

缺少 compatibilityDate (兼容性日期)

B5001

你的 Nuxt 配置中没有设置 compatibilityDate(兼容性日期)。Nuxt 使用该日期来决定应用哪些行为默认值,从而让你的项目在 Nuxt 和 Nitro 更新时保持稳定,而不是静默地采用新默认值。

解决方法

compatibilityDate 添加到你的 nuxt.config 中,使用今天的日期,以便选择加入当前的默认值:

export default defineNuxtConfig({
  // 使用当前日期,例如你添加这一行的当天
  compatibilityDate: 'YYYY-MM-DD',
})
阅读更多