Cannot add hosting in amplify hosting add - App not found

Viewed 176

I am slightly confused, I am able to deploy my code (dev env) without issues using amplify push:

Current Environment: dev

| Category | Resource name          | Operation | Provider plugin   |
| -------- | ---------------------- | --------- | ----------------- |
| Api      | littlewishlist         | Update    | awscloudformation |
| Auth     | littlewishlist7d5de4fe | No Change | awscloudformation |
? Are you sure you want to continue? Yes

.......

āœ” Generated GraphQL operations successfully and saved at src/graphql
āœ” All resources are updated in the cloud

GraphQL endpoint: https://XXXX.amazonaws.com/graphql
GraphQL API KEY: da2-XXX

Then when checking which evn's I have locally it says I have my dev environment:

(base) hutber@hutber:/var/www/littlewishlist/lwl$ amplify env list

| Environments |
| ------------ |
| *dev         |

But doing a amplify publish I recieve the following:

 Please add hosting to your project before publishing your project
 Command: amplify hosting add

So I then run the code: amplify hosting add

hutber@hutber:/var/www/littlewishlist/lwl$ amplify hosting add
? Select the plugin module to execute Hosting with Amplify Console (Managed hosting with custom domains, Continuous deployment)
App XXXX not found.
NotFoundException: App dc2bpv99poqrq not found.
1 Answers

Delete the amplify folder in your project and run

amplify init 

then follow the commands

amplify hosting add
amplify publish
Related