Amplify-cli: add api is broken

Created on 12 May 2019  路  7Comments  路  Source: aws-amplify/amplify-cli

do following
1)
$npm install -g @aws-amplify/cli

2)
$amplify init
3)
and choose visual studio code, react, javascript project

4)
$amplify add codegen --apiId xxxxxxx

xxxx is your aws appsync graphql api id

gives error,
Codegen support only one GraphQL API per project

this is a fresh new directory , fresh new amplify init and it tells me that i already have a backend api???
and there is no way to debug this there is no command such as
amplify api list etc

i also checked the generated json files there is no api mentioning in the json files.

looks like amplify add api is broken at this build.

Thank you

code-gen pending-response pending-triage

Most helpful comment

@EsrefDurna @UnleashedMind I had the same issue on windows. Uninstalling then re-installing the CLI didn't work but running amplify codegen remove then amplify add codegen --apiId xxxxxxxxxxxxx solved the problem for me.

All 7 comments

Thanks @EsrefDurna , we'll investigate this issue, could you provide these information for us?

  • Amplify CLI version
  • Operating system of your computer

amplify cli version 1.6.8
OS Mac OS mojave(latest)

@EsrefDurna
I was not able to reproduce the issue. But we will keep the issue open to investigate further on what happened and help you to resolve the issue you are having.
It'd be helpful if you can provide a screenshot of the error.

what about a screen capture?:)

sorry for the trouble, I reinstalled and it worked!

@EsrefDurna @UnleashedMind I had the same issue on windows. Uninstalling then re-installing the CLI didn't work but running amplify codegen remove then amplify add codegen --apiId xxxxxxxxxxxxx solved the problem for me.

Also have this issue today. I ran "amplify codegen remove" then "amplify codegen add". It works again now. Weird!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amlcodes picture amlcodes  路  3Comments

gabriel-wilkes picture gabriel-wilkes  路  3Comments

kstro21 picture kstro21  路  3Comments

mwarger picture mwarger  路  3Comments

rehos picture rehos  路  3Comments