Which Cloudflare product(s) does this pertain to?
Wrangler
What versions & operating system are you using?
wrangler 4.10.0
Please provide a link to a minimal reproduction
https://github.com/jyn514/redirect-worker/tree/super-broken
Describe the Bug
my worker has an internal error, which i want to see the message for. i ran curl -I to make it show up in the logs. instead of seeing my worker's error, i see a syntax error in wrangler internals:
[wrangler:err] SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at parseJSONFromBytes (/home/jyn/Documents/node-v20.12.2-linux-x64/lib/node_modules/wrangler/node_modules/undici/lib/fetch/body.js:590:15)
at successSteps (/home/jyn/Documents/node-v20.12.2-linux-x64/lib/node_modules/wrangler/node_modules/undici/lib/fetch/body.js:530:23)
at fullyReadBody (/home/jyn/Documents/node-v20.12.2-linux-x64/lib/node_modules/wrangler/node_modules/undici/lib/fetch/util.js:959:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async specConsumeBody (/home/jyn/Documents/node-v20.12.2-linux-x64/lib/node_modules/wrangler/node_modules/undici/lib/fetch/body.js:545:3)
at async handlePrettyErrorRequest (/home/jyn/Documents/node-v20.12.2-linux-x64/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:11164:40)
at async #handleLoopback (/home/jyn/Documents/node-v20.12.2-linux-x64/lib/node_modules/wrangler/node_modules/miniflare/dist/src/index.js:15458:20)
[wrangler:inf] HEAD / 500 Internal Server Error (3ms)
if i do a GET instead of a HEAD, i see the expected worker error:
[wrangler:err] ReferenceError: Url is not defined
at Object.fetch (file:///home/jyn/src/redirect-worker/src/worker.js:32:18)
at fetchDispatcher (file:///home/jyn/src/redirect-worker/.wrangler/tmp/bundle-HPW4lZ/middleware-loader.entry.ts:54:17)
[wrangler:inf] GET / 500 Internal Server Error (9ms)
steps to replicate:
- clone the repo in the issue description
wrangler dev
curl -I localhost:8787
Please provide any relevant error logs
n/a
Which Cloudflare product(s) does this pertain to?
Wrangler
What versions & operating system are you using?
wrangler 4.10.0
Please provide a link to a minimal reproduction
https://github.com/jyn514/redirect-worker/tree/super-broken
Describe the Bug
my worker has an internal error, which i want to see the message for. i ran
curl -Ito make it show up in the logs. instead of seeing my worker's error, i see a syntax error in wrangler internals:if i do a GET instead of a HEAD, i see the expected worker error:
steps to replicate:
wrangler devcurl -I localhost:8787Please provide any relevant error logs
n/a