【发布时间】:2021-11-17 09:11:02
【问题描述】:
我正在开发一个托管在 AWS 上的 typescript 网站,该网站通过 Github 存储库进行放大,我在部署该网站时遇到了间歇性问题。通常情况下,网站可以正确构建并且没有重大问题/障碍,但偶尔,网站会在构建的前端部分失败。
它给出的主要错误是:
2021-09-24T02:11:16.620Z [WARNING]: There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"babel-loader": "8.1.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-loader was detected higher up in the tree:
/codebuild/output/--/--/--/node_modules/babel-loader (version: 8.2.2)
Manually installing incompatible versions is known to cause hard-to-debug issues.
它继续详细说明为了解决这个问题而采取的一些步骤,我尝试了很多次都没有成功(删除锁、节点模块文件夹、从 package.json 中删除 babel-loader)我还尝试添加 SKIP_PREFLIGHT_CHECK =true 到 .env 文件。这样做解决了那个错误,但又引发了另一个错误,如下所述:
2021-09-24T02:07:11.394Z [INFO]: ./node_modules/@usedapp/core/node_modules/ethers/lib.esm/utils.js 30:0-32:73
Attempted import error: 'TransactionTypes' is not exported from '@ethersproject/transactions'.
再次,编译在我的个人机器上工作,并且仅在尝试在 Amazon Amplify 上构建相同的 Github 存储库时出现(间歇性)问题
如果您有任何想法或建议,请告诉我!
-剪辑
【问题讨论】:
标签: reactjs typescript deployment node-modules aws-amplify