AWS Amplify React JS 下一个错误源和目标不能相同

AWS Amplify React JS Next error Source and destination must not be the same

我正在尝试在 aws amplify 上部署我的 Reactjs Next 应用程序,但它在构建时显示错误

这是我的 amplify.yml 预构建和构建:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - echo 'ANUBI PREBUILD'
        - yarn install
    build:
      commands:
        - echo 'ANUBI BUILD'
        - INVESTORTOOLBOX_CONFIGFILE=./investortoolbox-config.json
        - yarn run build
    post_build:
      commands:
        - echo 'FINISHED!'
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*
  appRoot: .

它在本地环境中构建并且 运行 正确。 那是前端构建日志:

2022-01-14T21:33:33.787Z [INFO]: info  - Compiled successfully
                                 info  - Collecting page data... 2022-01-14T21:33:35.548Z [INFO]: info  - Generating static pages (0/33) 2022-01-14T21:33:35.635Z [INFO]: info  - Generating static pages (8/33) 2022-01-14T21:33:35.665Z [INFO]: info  - Generating static pages (16/33) 2022-01-14T21:33:35.688Z [INFO]: info  - Generating static pages (24/33) 2022-01-14T21:33:35.731Z [INFO]: info 
- Generating static pages (33/33) 2022-01-14T21:33:35.749Z [INFO]: info  - Finalizing page optimization... 2022-01-14T21:33:35.757Z [INFO]:  2022-01-14T21:33:35.773Z [INFO]: Page                         Size     First Load JS
                                 ┌ ● /                                      17.7 kB         290 kB
                                 ├   /_app                                  0 B            90.1 kB
                                 ├ ○ /404                                   196 B          90.3 kB
                                 ├ ● /heatmap                               2.59 kB         111 kB
                                 ├ ○ /hedgefund/[symbol]                    288 B          90.4 kB
                                 ├ ● /hedgefunds                            1.66 kB         131 kB
                                 ├ ● /news                                  2.59 kB         111 kB
                                 ├ ● /securities                            1.66 kB         131 kB
                                 ├ ● /security/[symbol]                     3.72 kB         136 kB
                                 ├   ├ /en/security/FB
                                 ├ ● /security/hedgefunds/[symbol]          4.49 kB         137 kB
                                 ├   ├ /en/security/hedgefunds/FB
                                 ├ ● /security/insiders/[symbol]            5.52 kB         278 kB
                                 ├   ├ /en/security/insiders/FB
                                 ├ λ /security/ratio/[ratio]/[symbol]       3.66 kB         133 kB
                                 └ ● /user/profile                          6.31 kB         115 kB
                                 + First Load JS shared by all              90.1 kB
                                 ├ chunks/framework-4975f770e34de116.js   42.2 kB
                                 ├ chunks/main-021d0a81dadf834e.js        27.8 kB
                                 ├ chunks/pages/_app-1b7a2c849914cce6.js  18.5 kB
                                 ├ chunks/webpack-a187f1e3bc19d705.js     1.66 kB
                                 └ css/9a77763e9d678bbb.css               25.6 kB 2022-01-14T21:33:35.774Z [INFO]: λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
                                 ○  (Static)  automatically rendered as static HTML (uses no initial props)
                                 ●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps) 2022-01-14T21:33:36.430Z [INFO]: Done in 26.56s. 2022-01-14T21:33:36.434Z [INFO]: Starting SSR Build... 2022-01-14T21:35:03.566Z [ERROR]: (node:2052) UnhandledPromiseRejectionWarning: Error: Source and destination must not be the same.
                                  at /root/./-patch.2/node_modules/fs-extra/lib/util/stat.js:39:17
                                  at cb (util.js:290:31)
                                  at processTicksAndRejections (internal/process/task_queues.js:82:21)
                                  (Use `node --trace-warnings ...` to show where the warning was created) Terminating logging...

能否尝试在应用程序设置下的 Live Packages 中将 NextJS 的版本设置为 11 或最新版本。以下是说明:enter link description here