New builds result in NextJS crash

Recently I updated a JSON file on my website's static assets folder, and today I noticed my site is showing a "Internal Server Error" screen Considering it is a minimal screen and not the cloudflare one, and cloudflare not showing any error rates on the metrics screen I imagine it is NextJS, I tried rebuilding on top of the latest commit and an old one that was working and both resulted on the same error, for now I have rolled back I am using an old successful build I have not changed any setting or option in the page since the successful deployment The deployment process was successful and showed no errors A bad build can be found on the following link: https://b1d3304f.awakened-web-4.pages.dev/ * Page: awakened-web-4.pages.dev * Deployment ID: b1d3304f-be3f-40b1-b53a-73178286cb84 * Account ID: 43ed6119115ef558f129d6beab848ec9 * Simple Internal Server Error screen
5 Replies
Chaika
Chaika5d ago
A good place to start is by tailing the broken deployment, and then sending a request to it, and expanding to see the error ?pages-logs
SuperHelpflare
If you're looking to tail a Pages Function you can do so in the UI here: https://dash.cloudflare.com?to=/:account/pages/view/:pages-project/:pages-deployment/functions or with Wrangler: wrangler pages deployment tail [deploymentId/url]
Awakened Redstone
The log mentions
"Error: No such module \"__next-on-pages-dist__/functions/async_hooks\".\n imported from \"__next-on-pages-dist__/functions/index.func.js\""
"Error: No such module \"__next-on-pages-dist__/functions/async_hooks\".\n imported from \"__next-on-pages-dist__/functions/index.func.js\""
which seems to be a next-on-pages function. It has been a long time since the successful deployment, a bit over 3 months, but looking at @cloudflare/next-on-pages releases on github there seem to be no major change in the tool
Chaika
Chaika5d ago
I don't remember the full context nor do I use nextjs but I remember Vercel caused this a while ago by starting to depend on async_hooks in their cli https://github.com/cloudflare/next-on-pages/issues/908#issuecomment-2506457110 is I believe what you should try, bumping compat date if you don't get a straight build failure then I'd try a preview build to not mess with prod again, of course
Awakened Redstone
That worked, thanks!

Did you find this page helpful?