从反应脚本构建中获取文件名?

Rob*_*ose 7 reactjs react-scripts yarnpkg

react-scripts build我正在使用纱线在私人打字稿存储库上运行。构建失败并显示以下消息:

yarn build -v
yarn run v1.22.17
$ react-scripts build -v
Creating an optimized production build...
Failed to compile.

TS2322: Type 'string | undefined' is not assignable to type 'string | number | boolean'.
  Type 'undefined' is not assignable to type 'string | number | boolean'.
    114 |       withCredentials: true,
    115 |       headers: {
  > 116 |         Authorization: token ? `Bearer ${token}` : undefined,
        |         ^^^^^^^^^^^^^
    117 |       },
    118 |     });
    119 |


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Run Code Online (Sandbox Code Playgroud)

我理解该错误,但我找不到错误所在的文件,因为react-scripts build似乎没有输出文件名?我不确定这是否是我的本地配置的问题,但是有没有办法让反应脚本告诉我这个错误到底在哪里?