migration banner on app homepage disappeared after cancelling

0

I was intended to migrate the beta branch of our app from Next11 to Next12. However, I noticed that the migration task has been started over all branches including the branch for production, so I canceled the task that was going on in that branch.

The problem is, even though I cancelled the migration, the banner section shows nothing and it seems there's no ways to see a 'migrate' button again. Moreover, when I retry to re-build the beta branch, the build terminal shows an error like this because the migration task has been not completed:

!! CustomerError: Please update your Next.js version to 12 or newer and re-run your build to migrate to Amplify Hosting Compute. Learn More: https://docs.aws.amazon.com/amplify/latest/userguide/server-side-rendering-

My question is: Is there any way to re-run the migration process on amplify console? Is it possible to selectively migrate the branch on the console?

1 Answer
0
Accepted Answer

Hello,

The reason you are not seeing the migrate option is because the application is successfully migrated. You will be able to confirm the same by navigating to your amplify app -> App settings -> General. You should see that the platform changed to Web dynamic.

Before migrating to NextJS 12 or later you would need to update the package.json file as mentioned in the below documentation.

[1] https://docs.aws.amazon.com/amplify/latest/userguide/update-app-nextjs-version.html

The error “!! CustomerError: Please update your Next.js version to 12 or newer and re-run your build to migrate to Amplify Hosting Compute. Learn More: https://docs.aws.amazon.com/amplify/latest/userguide/server-side-rendering-“ occurs when you migrate your application before updating the nextjs version in the package.json file. To resolve the same, please update the file as mentioned in the above documentation [1].

Lastly, the migration is at the application level. When you migrate your application, the build will be triggered automatically for your production branch. For all other branches you would need to trigger the build manually. Hence, this is the reason you observed build getting triggered for the production branch. Upon clicking cancel has cancelled the build and not the migration, as migration was already completed.

If you would like to test it in your beta branch first, one possible solution is to change the production branch to beta branch(App settings -> General -> Production branch) or disable the auto build so that when migration happens the build will be triggered for the beta branch. This will help you in testing the beta before deploying your main branch.

To summarize, you won’t be seeing the migrate option when migration is complete. Incase, if you would like to revert back the migration please see [2]. Also, it is not possible to selectively migrate at the branch level.

[2] https://docs.aws.amazon.com/amplify/latest/userguide/update-app-nextjs-version.html#revert-ssr-migration

AWS
answered a year ago
  • Hi, thank you for your answer. It turned out the beta branch was pointing the older commit that includes next11 version in package.json and that's why the build script showed the version error.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions