next-on-pages data caching does not work

Related to: https://github.com/cloudflare/next-on-pages/issues/799 Data which is fetched via the 'fetch' function is not cached, and gets re-fetched every page load regardless of the values of 'revalidate' or 'tags'. Building and running the next application locally with: npx @cloudflare/next-on-pages and npx wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat results in following error on page load:
✘ [ERROR] workerd/jsg/util.c++:278: error: e = kj/async-io-unix.c++:1299: failed: DNS lookup failed.; params.host = internal_suspense_cache_hostname.local; params.service = ; gai_strerror(status) = Temporary failure in name resolution

stack:
/home/dev/tmp/fetch-test/node_modules/@cloudflare/workerd-linux-64/bin/workerd@586542c
[...]
/home/dev/tmp/fetch-test/node_modules/@cloudflare/workerd-linux-64/bin/workerd@35e19fc;
sentryErrorContext = jsgInternalError


✘ [ERROR] workerd/jsg/util.c++:278: error: e = kj/async-io-unix.c++:1299: failed: DNS lookup failed.; params.host = internal_suspense_cache_hostname.local; params.service = ; gai_strerror(status) = Temporary failure in name resolution

stack:
/home/dev/tmp/fetch-test/node_modules/@cloudflare/workerd-linux-64/bin/workerd@586542c
[...]
/home/dev/tmp/fetch-test/node_modules/@cloudflare/workerd-linux-64/bin/workerd@35ae5c0;
sentryErrorContext = jsgInternalError


✘ [ERROR] Uncaught (async) Error: internal error


[wrangler:inf] GET / 200 OK (353ms)
✘ [ERROR] workerd/jsg/util.c++:278: error: e = kj/async-io-unix.c++:1299: failed: DNS lookup failed.; params.host = internal_suspense_cache_hostname.local; params.service = ; gai_strerror(status) = Temporary failure in name resolution

stack:
/home/dev/tmp/fetch-test/node_modules/@cloudflare/workerd-linux-64/bin/workerd@586542c
[...]
/home/dev/tmp/fetch-test/node_modules/@cloudflare/workerd-linux-64/bin/workerd@35e19fc;
sentryErrorContext = jsgInternalError


✘ [ERROR] workerd/jsg/util.c++:278: error: e = kj/async-io-unix.c++:1299: failed: DNS lookup failed.; params.host = internal_suspense_cache_hostname.local; params.service = ; gai_strerror(status) = Temporary failure in name resolution

stack:
/home/dev/tmp/fetch-test/node_modules/@cloudflare/workerd-linux-64/bin/workerd@586542c
[...]
/home/dev/tmp/fetch-test/node_modules/@cloudflare/workerd-linux-64/bin/workerd@35ae5c0;
sentryErrorContext = jsgInternalError


✘ [ERROR] Uncaught (async) Error: internal error


[wrangler:inf] GET / 200 OK (353ms)
minimal reproducible example https://github.com/ilovemesomeramen/next-on-pages-cache-issue any help would be appreciated!
GitHub
[🐛 Bug]: Next fetch caching having issues in [email protected] ·...
next-on-pages environment related information System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:17:33 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6031 CPU...
GitHub
GitHub - ilovemesomeramen/next-on-pages-cache-issue
Contribute to ilovemesomeramen/next-on-pages-cache-issue development by creating an account on GitHub.
1 Reply
hal
hal5mo ago
I get the following error locally Uncaught (async) Error: internal error (the logs don't show more) when running wrangler pages dev in a new nextjs project using c3 cli. with fetch and unstable_cache , on top of that for a simple request i get really high latency but deployments work normally i found out that if you change the compatibility date to 2 months ago it works locally for instance i tried 2024-05-22
Want results from more Discord servers?
Add your server