Closed matansagee closed 3 years ago
@matansagee could you please provide the screenshot as it was not uploaded, also do I understand correctly that you try it in Amplify Console and that succeeds, but when you try to push it locally it fails? As that error message is quite interesting, is that possible that something is wrong in your configured AWS profile files in ~/.aws
folder? based on the log it looks like the problem is there?
Hi @attilah ! Thanks for looking at this issue. Screenshots attached.
It happens when I'm doing amplify push --force
from my Mac.
It doesn't happen when Amplify CICD is doing amplifyPush --simple
@matansagee another idea is that your local src/aws-exports.js
is corrupt and or have manual modifications. Could you check that file for errors?
Or delete it and then try the push locally?
Hi @attilah. It's not coming from the src/aws-exports.js
file.
Moreover, the ~/.aws
folder looks intact also.
Is there a way to print which is the problematic file?
If you up to build CLI yourself then I could point you to the place where this is happening and then the stacktrace could tell us what is failing as it fails to some JS error, which is usually when we require
some generated files. Let me know.
@attilah Sure. Please refer me to the file in the code. Thanks!
This is the actual line in the catch where you should put the breakpoint after running amplify-dev push --yes
Find the instructions on setting up local dev here: https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#local-environment-setup
Thanks for your help!
Hi @attilah! I built the CLI, and amplify-dev push --yes
ends successfully! However, amplify push --yes
fails.
I tried to uninstall the amplify CLI and install it again but getting the same failure message. Is there anything else I can do?
@matansagee, I still see the syntax error in both cases, could you put a breakpoint on the line I linked above and see what is in the stacktrace and see what is wrong?
Also can you try a push --yes with 5.0.2 that we just released?
@attilah I tried with the 5.0.2 version still no success. Same error as with 5.0.1.
And, I'm not getting the error with the amplify-dev push --yes
,
@matansagee can you try with version 5.1.0 of the CLI. If you aren't seeing the issue with amplify-dev
, but you are with amplify
can you also run amplify -v
immediately before or after as a quick check (it's surprisingly easy to be running the wrong version of the CLI even after a fresh install).
Hey @matansagee :wave: are you still experiencing this issue with the latest version of the CLI? Just wanted to check in 🙂
Closing issue due to inactivity. @matansagee if you are still experiencing this issue with the latest version of the CLI please reply back to this thread and we can re-open to investigate further.
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 *-help
channels for those types of questions.
Before opening, please confirm:
How did you install the Amplify CLI?
sudo npm install -g @aws-amplify/cli
If applicable, what version of Node.js are you using?
v12.20.0
Amplify CLI Version
5.0.1
What operating system are you using?
Mac
Amplify Categories
Not applicable
Amplify Commands
push
Describe the bug
amplify push --force
from my mac is failing onAn error occurred during the push operation: Invalid or unexpected token.
Build with'amplifyPush --simple'
ends successfully. ![Uploading image.png…]()Expected behavior
Push successfully
Reproduction steps
Installed the latest CLI. Amplify push has stopped working.
GraphQL schema(s)
Log output
Additional information
No response