my React app uses GraphQL API, Storage, Auth, Functions, Hosting - all the fun stuff - so i must have an aws-exports.js
file available. Amplify React Front end with Amplify Backend resources.
Repo basically setup as:
package.json
src/
- aws-exports.js
- app.js
- ...etc
and doing an ls
in each dir showed on builds that there was no aws-exports.js
file generated.
With many different configs, i am met with:
[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.
This is so when i have a checked in amplify.yml
and also configuring the .yml
in the web console.
I've tried amplify push;
but as expected met with
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
Also trying: 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
Which just hangs and expects input. I dont think manually putting in creds like this is as all the way to go about this.
It seems as though amplify should handle this generation of aws-exports.js
itself considering all the backend integrations. When ls
different. There are a number of questions around on this that are quite current but with no real answer. Thanks for your time