我的 React 应用程序使用 GraphQL API、存储、身份验证、函数、托管 - 所有有趣的东西 - 所以我必须有一个aws-exports.js
文件可用。使用放大后端资源来放大 React 前端。
回购协议基本上设置为:
package.json
src/
- aws-exports.js
- app.js
- ...etc
并做一个ls
在每个目录中都显示构建没有aws-exports.js
生成的文件。
通过许多不同的配置,我遇到了:
[INFO]: # Executing command: yarn run build
[INFO]: yarn run v1.16.0
[INFO]: $ react-scripts build
[INFO]: Creating an optimized production build...
[INFO]: Failed to compile.
[INFO]: ./src/App.js
Cannot find file './aws-exports' in './src'.
2020-04-30T00:52:34.883Z [WARNING]: error Command failed with exit code 1.
当我登记入住时就是这样amplify.yml
并配置.yml
在网络控制台中。
我试过了amplify push;
但果然遇到了
An error occured during the push operation: Current environment cannot be determined
Use 'amplify init' in the root of your app directory to initialize your project with Amplify
还尝试:amplify pull;
or Executing command: amplify pull --appId abc123abc123 --envName dev
# Starting phase: preBuild
# Executing command: amplify pull
For more information on AWS Profiles, see: https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
? Do you want to use an AWS profile? (Y/n)
.[43D.[43C
它只是挂起并等待输入。我不认为像这样手动输入信用是解决此问题的所有方法。
似乎 amplify 应该处理这一代aws-exports.js
本身考虑所有后端集成。什么时候ls
不同的。关于这个问题有很多当前的问题,但没有真正的答案。谢谢你的时间