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개 답변
0
수락된 답변

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
답변함 일 년 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠