The deployment to the workers is successful, but I get a 500 error when accessing it. (nextjs13)

I'm deploying Next.js13 using the wrangler command. Although the deployment succeeds, I'm encountering a 500 error.

The Next.js page fetches from the API and server-side rendering(all pages)
I'm not using App router

It's puzzling because sometimes it works. Occasionally, after running yarn vercel build, I am prompted to execute vercel pull, and it succeeds afterward. However, this is also sporadic. I cannot determine a consistent way to reproduce the issue. How should I troubleshoot this?

The static images are loading fine, so it seems the issue lies with the workers. Is there a way to check the logs to ensure the workers are operating correctly?


This is my deployment procedure.

yarn
 yarn run build
 yarn vercel build
 npx @cloudflare/next-on-pages@1
CLOUDFLARE_ACCOUNT_ID=xx CLOUDFLARE_API_TOKEN=yy wrangler pages publish .vercel/output/static  --project-name=xx --branch=xx
Was this page helpful?