question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

amplify env checkout <env> should update aws-exports.js file

See original GitHub issue

Describe the bug

When you do amplify env checkout <env> the aws-exports.js file does not update, it will still contain settings of the previous environment.

To work around this, you can do amplify init and choose an existing environment and choose the <env> you checkout to.

To Reproduce

  1. Check aws-exports.js
  2. Do amplify env checkout <env>
  3. Check aws-exports.js
  4. Realize that it hasn’t changed to reflect the environment settings you are in.

Expected behavior

amplify env checkout <env> should update aws-exports.js file to reflect the settings of the current environment you checkout to.

Additional context

To work around this, you can do amplify init and choose an existing environment and choose the <env> you checkout to.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
ivankokuscommented, Jan 27, 2021

still not solved in amplify -v 4.40.0

3reactions
attilahcommented, Nov 6, 2019

@aprilmintacpineda it seems to be a valid request, I marked it as a bug, thanks for reporting it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment variables - AWS Amplify Hosting
By default, Amplify applies the environment variables across all branches, so you don't have to re-enter variables when you connect a new branch....
Read more >
Advanced workflows - Headless mode for CI/CD - Amplify Docs
The CLI will place and update the aws-exports.js file in it, the aws-exports.js file is used to configure the Amplify JS library.
Read more >
If you use Amplify and Git branches, you are going to have a ...
Creates/modifies files that say "what is the current environment in this machine". Similarly to Git, where you can checkout multiple branches ...
Read more >
What happens if I edit aws-exports.js? - Stack Overflow
If you edit it, it won't affect any of the backend configuration, and will be re-generated on backend changes. It's true that Amplify...
Read more >
Amplify multi-env setup causing my production build with ...
I created two environment branch on both git and amplify - dev and production. ... setup switch to production is by checking inside...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found