我是工作在一个类型记录网站,是托管在AWS放大通过一个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扩容上构建相同的Github回购时出现(间歇性)问题。
如果你有什么想法或建议,请告诉我!
-Snips
发布于 2021-09-24 03:03:52
看起来,您使用的库并没有导出您需要的东西,如果您控制这个库,就应该导出它。确保在您的"isolatedModules": true中设置了tsconfig.json
https://stackoverflow.com/questions/69308991
复制相似问题