Nextjs Build failed with "Failed: an internal error occurred"

I used Nextjs version “13.4.9”
Trying to build the project as SSG but failed when trying to collecting pages data like the screenshot

The build take 36 minutes and failed after it
I know the timeout of the build max 20 minutes
But the build remain until 36 minutes without any issue or timeout messages

Anyone face this issue?