[๐ Bug]: error code: 1016
next-on-pages environment related information
System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Fri, 31 May 2024 15:14:45 +0000
CPU: (4) x64 11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz
Memory: 7 GB
Shell: /usr/bin/zsh
Package Manager Used: npm (10.8.1)
Relevant Packages:
@cloudflare/next-on-pages: 1.11.3
vercel: 34.2.3
next: 14.2.3
Description
Hi, so, I have been trying to migrate a site from Vercel to CF pages, but it's a new problem at every step, first was an issue with the bun version that cf uses, and now this.
Ran npx @cloudflare/next-on-pages@latest without any serious warnings or errors. After deployment, I got a
Application error: a client-side exception has occurred (see the browser console for more information).
Then checked the runtime logs with npx wrangler pages deployment tail, which gives me
GET https://mydomain/ - Ok @ 6/9/2024, 2:59:49 PM
(error) error code: 1016
(error) SyntaxError: Unexpected token 'e', "error code: 1003" is not valid JSON
(error) SyntaxError: Unexpected token 'e', "error code: 1003" is not valid JSON
Can't make any external API requests from the site. So, I started wrangler dev locally with npx wrangler pages dev .vercel/output/static, and this is what I get everytime,
[wrangler:inf] GET /student/01096202722 200 OK (2069ms)
โ [ERROR] workerd/jsg/util.c++:251: error: e = kj/async-io-unix.c++:1298: failed: DNS lookup failed.; params.host = internal_suspense_cache_hostname.local; params.service = ; gai_strerror(status) = Name or service not known
stack:
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@57da5cc
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@57dafe0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@3fb3790
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@410b810
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@410d290
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@410d9f0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4121040
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@33d9546
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2de5310
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@357f4f0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@35797f0;
sentryErrorContext = jsgInternalError
โ [ERROR] workerd/jsg/util.c++:251: error: e = kj/async-io-unix.c++:1298: failed: DNS lookup failed.; params.host = internal_suspense_cache_hostname.local; params.service = ; gai_strerror(status) = Name or service not known
stack:
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@57da5cc
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@57dafe0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@3fb3790
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@410b810
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@410d290
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@410d9f0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4121040
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@33d9546
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2de5310
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@357f4f0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@35797f0;
sentryErrorContext = jsgInternalError
โ [ERROR] A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished.
โ [ERROR] workerd/server/server.c++:3346: error: Uncaught exception: workerd/io/io-context.c++:1167: failed: remote.jsg.Error: The script will never generate a response.
stack:
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@338c5c0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@338dbb0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@338e460
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@33d935d
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2de5310
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@411945b
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@579deef
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4117ba0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2ddb010
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@37d3f00
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@3509cf0
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@350a124
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@579deef
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@338e460
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2e0185c
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@412c087
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@412d20b
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@412dbec
/home/martian/.npm/_npx/32026684e21afda6/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40f0160
โ [ERROR] Uncaught (in response) Error: The script will never generate a response.
I added a comment on an issue that looks similar in the workerd repo here.
I am not sure if the local errors (in wrangler dev) are related to the one in the deployment, so does anyone have any clue?
Reproduction
No response
Pages Deployment Method
Pages CI (GitHub/GitLab integration)
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
- [ ] Would you like to help fixing this bug?
Fixed: It was just a DNS issue on my machine, And a coincidence that an ENV var needed updating on the cf pages project.
Nvm, still a DNS issue with cloudflare workers. I randomly get a client side exception just like I do on localhost because of the DNS issues.
I recive the same error when I try to use a client certificate for an API call.
I can't cath the exception stacktrace
I am experiencing a similar issue
i experienced this issue as well, reverting the compability date to compatibility_date = "2023-12-01" fixed this issue
Hello ๐ Thank you for the issue and apologies for the late reply.
Earlier this year we released our Cloudflare adapter for OpenNext, and we have been continuously investing effort in its improvement since then. Existing deployments can continue to use the next-on-pages tooling, but the Cloudflare adapter for OpenNext is currently stable and recommended for deployment of Next.js applications to Cloudflare.
As such, we will no longer be maintaining next-on-pages. We recently deprecated the package on npm and we plan to archive this repo on Monday Sep 29, 2025. In preparation for archival, we are closing all open issues and PRs.
If you have concerns, please feel free to reply here before the repo is archived (after that, it will no longer be possible to comment) or to reach out to our team on Discord.
Thanks so much for using and contributing to next-on-pages ๐งก