Internal Server Error on Cloudlfare Pages
Hi everyone,
I've been having a big problem with Cloudflare Pages for a while now. When I deploy a page created in NextJS from my desktop computer (Mac Mini), I get an error “Internal Server Error' (https://develop.plgbc-web.pages.dev/) when I access the page, but when I flip the code without any changes to my laptop (Macbook Pro) and upload it, the same page works without any problem.
During the deployment there is no error, nothing like that, the site uploads on cloudlfare but does not work.
I should also add that I have this in every possible project
I have the same version of Wrangler 3.61.0 on both computers,
I use @Cloudflare/next-on-pages version 1.13.8
11 Replies
missing dep or something? you're best bet is to look at the logs, we can't really guess why it fails
npx wrangler pages deployment tail
Connected to deployment 624b7111-843d-4d45-ad18-df23b5ba5452, waiting for logs...
GET https://plgbc-web.pages.dev/ - Ok @ 2/27/2025, 4:12:58 PM
(error) Error: No such module "next-on-pages-dist/functions/async_hooks".
imported from "next-on-pages-dist/functions/index.func.js"
GET https://plgbc-web.pages.dev/favicon.ico - Ok @ 2/27/2025, 4:12:58 PM
(error) Error: No such module "next-on-pages-dist/functions/async_hooks".
imported from "next-on-pages-dist/functions/_not-found.func.js"
any idea?
No such module "next-on-pages-dist/functions/async_hooks".do you have nodejs_compat?
my wrangler.toml
name = "plgbc-web"
compatibility_date = "2024-07-29"
compatibility_flags = ["nodejs_compat"]
pages_build_output_dir = ".vercel/output/static"
GitHub
[🐛 Bug]: ERROR Could not resolve "async_hooks" · Issue #908 · cloud...
next-on-pages environment related information System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 CPU...
In the end, all I had to do was update the compatibility_date = "2024-09-23" which is newer than you will find in the cloudflare + nextjs docs in the wrangler exampletry that
after changing compatibility_date, there is still an error but in the page itself (it already crawls the page code, styles, etc...)
I think I can handle it already, thanks
Can you ensure that you are using a recent compatibility date and on the latest version of next-on-pages
Oh oops i didnt read the full thread before replying, ignore me you already checked!
Hello,
I have the same error when i upgrade to next 15.2.0.
v15 isn’t officially supported by next on pages, i would suggest using the OpenNext adaptor instead.
oh ok, (it works fine with 15.1.7)