【问题标题】:Next.js 13 - Error: The "target" property is no longer supported in next.config.js, Even next.config.js does not have the target propertyNext.js 13 - 错误:next.config.js 不再支持 \"target\" 属性,即使 next.config.js 也没有 target 属性
【发布时间】:2022-12-03 00:03:45
【问题描述】:

我将我的 next.js 应用程序升级到 Next.js 13,并将新版本推送到 AWS Amplify。由于此错误,构建失败:next.config.js 不再支持“target”属性

Error: The "target" property is no longer supported in next.config.js. See more info here https://nextjs.org/docs/messages/deprecated-target-config at Object.loadConfig [as default (/codebuild/output/src405507991/src/assistian/node_modules/next/dist/server/config.js:97:19)

这是我没有目标的 next.config.js:

/** @type {import('next').NextConfig} */
module.exports = {
  webpack(config) {
    config.module.rules.push({
      test: /\.svg$/i,
      issuer: /\.[jt]sx?$/,
      use: ['@svgr/webpack'],
    })
    return config
  }
}

对出了什么问题有什么意见吗?

【问题讨论】:

  • 我也面临同样的问题。

标签: next.js


【解决方案1】:

根据https://github.com/vercel/next.js/issues/41932,此时似乎不受支持

【讨论】:

    【解决方案2】:

    Amplify 目前通过迁移支持高于版本 11 的 NextJS 版本。看这里:https://docs.aws.amazon.com/amplify/latest/userguide/update-app-nextjs-version.html

    【讨论】:

      猜你喜欢
      • 2022-11-16
      • 2022-08-22
      • 1970-01-01
      • 2021-10-24
      • 1970-01-01
      • 1970-01-01
      • 2017-12-08
      • 2010-10-06
      • 1970-01-01
      相关资源
      最近更新 更多