aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
457 stars 115 forks source link

Nextjs Github Build fails, deletes Amplify App #2330

Closed vivadel-vivek closed 2 years ago

vivadel-vivek commented 3 years ago

Before opening, please confirm:

App Id

d24emid7ho6933

Region

us-east-1

Amplify Console feature

Custom builds

Describe the bug

AWS Amplify deploy through the Amplify console does not build my app - rather deletes the app in Amplify.

I have attempted a few times to deploy with github integration on branch Main and to deploy manually with a zipped file, with the same behavior for both.

I am attempting to deploy a very simple next-js application. Just a landing page and an email api route.

On following the steps to create the app, I hit deploy and the site goes into pre-build steps. These appear to complete. It is then in the build steps that some error hangs - it gets stuck on collecting fresh packages, and on refreshing the page my entire app is gone. I have also tried this with manual deployment.

Dependencies and scripts for build are below:

"scripts": { "dev": "next dev", "build": "next build", "start": "next start" }, "dependencies": { "@chakra-ui/icons": "^1.0.15", "@chakra-ui/react": "^1.6.7", "@emotion/react": "11", "@emotion/styled": "11", "@fontsource/inter": "^4.5.0", "@fontsource/oxygen": "^4.5.0", "axios": "^0.23.0", "framer-motion": "4", "next": "11.1.2", "nodemailer": "^6.7.0", "react": "17.0.2", "react-dom": "17.0.2", "react-icons": "^4.2.0", "sharp": "^0.29.1" }, "devDependencies": { "@types/react": "^17.0.21", "typescript": "^4.4.3" }

Expected behavior

On integrating with github and deploying, my app should be built successfully. It is not, and in fact deletes the app on Amplify altogether.

Reproduction steps

  1. Go to amplify console
  2. Connect github
  3. Choose application with next/chakra/nodemailer/etc packages as above
  4. Deploy
  5. Wait for deployment to hang in build steps
  6. Refresh page to see your app gone

Build Settings

"scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "@chakra-ui/icons": "^1.0.15",
    "@chakra-ui/react": "^1.6.7",
    "@emotion/react": "11",
    "@emotion/styled": "11",
    "@fontsource/inter": "^4.5.0",
    "@fontsource/oxygen": "^4.5.0",
    "axios": "^0.23.0",
    "framer-motion": "4",
    "next": "11.1.2",
    "nodemailer": "^6.7.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-icons": "^4.2.0",
    "sharp": "^0.29.1"
  },
  "devDependencies": {
    "@types/react": "^17.0.21",
    "typescript": "^4.4.3"
  }

Additional information

No response

github-actions[bot] commented 3 years ago

Hi :wave:, thanks for opening! While we look into this...

If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.

Lastly, please make sure you've specified the App ID and Region in the issue!

victorccccc commented 2 years ago

Sorry for the delay. Your builds succeeded, the account was suspended at some point. I've recovered your account.

Feel free to reopen this if issue persists, thanks!

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.