-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-exports.js is not generated #186
Comments
You will need to run |
OK, thanks. Please improve the documentation. It is counterintuitive and I don't see this piece of information in the README.md either. |
Hi Please visit the following link for more detailed documentation: https://aws-amplify.github.io/amplify-js/media/quick_start?platform=purejs |
Even after the third read I find it utterly confusing, and I have usability issues too. Why should I push something that I could not have run locally? It is untested and most likely buggy but I cannot run In other words, on the first push, I would have to push something that is most likely broken because it has never been run (but I cannot run it). I also find the https://aws-amplify.github.io/amplify-js/media/quick_start?platform=purejs page utterly confusing. Generating |
Thanks for the feedbacks. |
I'm having a similar issue where even after init, recreating storage/auth resources, and pushing, I still don't have an When I init'ed the project i chose:
and when I pushed, it created auth/storage resources correctly, as well |
@caffodian I couldn't reproduce the issue with the latest version of the CLI. Many a times VS code bugs out and doesn't sync with my local filesystem to display the newly created files. Closing this issue for now. Please let me know if you're able to re-produce this with he latest version of the CLI. |
@kaustavghosh06 I don't see how my objections were resolved. |
@baharev There is no way to locally test your AWS resources without pushing it. So I'm not sure what would you test with an empty aws_exports.js file without actually pushing your resources. |
@kaustavghosh06 I found this issue for the same reasons @baharev did. |
@jmanek If you look into our AWS Amplify documentation - https://aws-amplify.github.io/docs/cli/init you would observe that there isn't a lot of magic happening with the Amplify CLI. You can notice in the documentation that the CLI uses AWS Cloudformation underneath to create and manage your AWS resources. These Cloudformation files are created for you in your |
@kaustavghosh06 I appreciate the detailed response. My magic comment was only referring to the generation of |
Edit: confirmed it generates after |
I faced the same issue. In my case, when prompted during
Make sure to choose Here is what my generated
|
Everything works fine. When I have to specify the source folder I put "www" instead of "src". |
@rkuzsma For android projects, the CLI generates an |
Closing this issue for now. Please feel free to re-open this if you have further questions. |
@kaustavghosh06 Once again, I don't see how my objections were resolved. In reply to your earlier comment: Who said that I want to test my AWS resources? And why would I want to test AWS? |
@baharev I'm not clear as to what you're advocating here. |
@kaustavghosh06 I would like to test my own client-side code, which imports aws_exports.js. Note that the code would run just fine without any AWS resource being available but it needs the aws_exports.js or the |
@baharev Please use the new install of the CLI. We genarate an aws_exports file on the first |
@kaustavghosh06 Hmm interesting, I don't see any difference except here's my output: As you can see, only amplify push generates the aws-exports.js... let me know if there's anything else you would like me try! I should note that I do have amplify profiles from two different organizations on my laptop, just in case it might be related to this issue. |
@kaustavghosh06 any update on this issue? |
I had the same issue. What I was doing wrong was when I was setting my source destination during "amplify init", I was giving this "/src". So this is not the correct path as this means the initial destination of your partition, eg: D:/ or C:/. |
You can update it using "amplify update project" |
@richardzyx did you find your answer? i am also having this issue except the fact is that, aws-exports is not generated on my CI server on Update: it seems like the execution never went past this line on my ubuntu box.
basically whenever it reaches await, it seems that the loop exited. And it seems it only happen on my ubuntu machine but not on my macOS, this is really weird. |
@richardzyx it seems that the promise is not resolved correctly but i could not understand why it work on my mac and not on my CI server. |
On my mac and in CodeBuild the aws-exports.js is not generated:
No src/aws-exports is generated. I am on amplify CLI v1.1.7. Does anyone have a workaround? Right now all our environments are broken as the aws-exports is not generated. Adding it to git won't help as it will be wrong for all our cloud envs. |
@chris-merapar I think it will work on node lts/carbon node 8.15.1. Are you using node 10? |
Confirmed it works ok with CodeBuild image aws/codebuild/nodejs:8.11.0 Thanks for the tip! |
@chris-merapar no prob |
It would be good if we can regenerate aws-exports as well, is this possible with the cli? |
Agree. I have found my aws-exports does not always update, especially if I delete resources then init a new project. It will be stuck without updating to the new resources. It would be good to be able to do a complete project update/overwrite. |
any updates on this? |
What is the recommended approach for handling this issue in a CI env? I'm using MS Appcenter for my builds and its failing because aws-exports.js is missing. I am unable to generate the aws-exports.js file via amplify push as it says no change. I'm on node v12.4.0. |
@isubasinghe |
The aws-exports.js is in .gitignore file and the only ways to generate are so heavy. It's a must-have that lightweight cli option to just generate the aws-exports.js. |
While I think it logically makes sense to be able to download the exports file again - it doesn't seem like a high priority to fix. Note: The documented bullet proof solution should be:
As you are already logged in on your computer it will ask something like this: Do you want to use an existing environment? Yes
Choose the environment you would like to use: develop
Choose your default editor: Visual Studio Code
Do you want to use an AWS profile? Yes
Please choose the profile you want to use SELECT PREVIOUS PROFILE
etc... Having done this you will then need to run |
Just in case it helps someone I did all the above steps but turns out |
So... I think this should be included somehow on the default build image as Amplify is supposed to support different environments and we aren't able to build the apps properly because of this missing file. NOTE: I think this is a major issue that's making me reconsider using Amplify... |
amplify is not capable of doing basic things like creating a config file. we have abandoned its use in favor of Microsoft Azure, we wasted our time learning amplify |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
For anyone who lands here, the Amplify console just released a way so that you can autogenerate the aws-exports file at build time without checking it into your git repo: https://docs.aws.amazon.com/amplify/latest/userguide/amplify-config-autogeneration.html |
I created a new hello world app with create-react-app. Followed the instructions on https://github.com/aws-amplify/amplify-cli and added auth and hosting to my hello world react app. The amplify cli did not report any errors, but reported OK. As far as I can tell all the necessary files were created by the amplify cli in the amplify subdirectory of the project.
amplify status
does show Auth. Everything looks OK except that the aws-exports.js is nowhere to find in the entire project folder.Repeated the whole thing again, with the same result.
Everything is at the latest version as of Sep 21, 2018.
The text was updated successfully, but these errors were encountered: