o0th
o0th
CDCloudflare Developers
Created by o0th on 4/22/2024 in #workers-help
✘ [ERROR] Error on remote worker: TypeError: fetch failed
While running wrangler dev with the flag --remote I'm getting this error:
[wrangler:inf] Ready on http://localhost:8787
Total Upload: 1037.42 KiB / gzip: 193.37 KiB
✘ [ERROR] Error on remote worker: TypeError: fetch failed

at fetch
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:17033:19)
at async performApiFetch
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:121199:10)
at async fetchInternal
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:121209:20)
at async fetchResult
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:121363:16)
at async createPreviewToken
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:169820:29)
at async createWorkerPreview
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:169841:17)
at async start
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:170428:34)
{
cause: Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
at handleWriteReq (node:internal/stream_base_commons:51:26)
at writeGeneric (node:internal/stream_base_commons:149:15)
at Socket._writeGeneric (node:net:962:11)
at Socket._write (node:net:974:8)
at doWrite (node:internal/streams/writable:411:12)
at clearBuffer (node:internal/streams/writable:572:7)
at Writable.uncork (node:internal/streams/writable:351:7)
at AsyncWriter.write
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:8071:16)
at writeIterable
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:8009:23)
{
errno: -32,
code: 'EPIPE',
syscall: 'write'
}
}
[wrangler:inf] Ready on http://localhost:8787
Total Upload: 1037.42 KiB / gzip: 193.37 KiB
✘ [ERROR] Error on remote worker: TypeError: fetch failed

at fetch
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:17033:19)
at async performApiFetch
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:121199:10)
at async fetchInternal
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:121209:20)
at async fetchResult
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:121363:16)
at async createPreviewToken
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:169820:29)
at async createWorkerPreview
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:169841:17)
at async start
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:170428:34)
{
cause: Error: write EPIPE
at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
at handleWriteReq (node:internal/stream_base_commons:51:26)
at writeGeneric (node:internal/stream_base_commons:149:15)
at Socket._writeGeneric (node:net:962:11)
at Socket._write (node:net:974:8)
at doWrite (node:internal/streams/writable:411:12)
at clearBuffer (node:internal/streams/writable:572:7)
at Writable.uncork (node:internal/streams/writable:351:7)
at AsyncWriter.write
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:8071:16)
at writeIterable
(/<dir>/node_modules/wrangler/wrangler-dist/cli.js:8009:23)
{
errno: -32,
code: 'EPIPE',
syscall: 'write'
}
}
Running the same on linux everything fine. This is Apple M2 Pro with macOS 14.4.1 (23E224)
1 replies
CDCloudflare Developers
Created by o0th on 7/19/2023 in #workers-help
waitUntil illigal invocation
I was planning to use waitUntil, but as soon it runs the worker die with this error:
[mf:err] TypeError: Illegal invocation
at Object.fetch (/path/src/index.js:59:5)
at __facade_modules_fetch__ (/tmp/tmp-778150-oye4YPdtwnN2/middleware-loader.entry.ts:46:16)
at __facade_invokeChain__ (/path/node_modules/wrangler/templates/middleware/common.ts:53:9)
at Object.next (/path/node_modules/wrangler/templates/middleware/common.ts:50:11)
at jsonError (/path/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:30)
at __facade_invokeChain__ (/path/node_modules/wrangler/templates/middleware/common.ts:53:9)
at __facade_invoke__ (/path/node_modules/wrangler/templates/middleware/common.ts:63:9)
at Object.fetch (/tmp/tmp-778150-oye4YPdtwnN2/middleware-loader.entry.ts:114:11)
[mf:err] TypeError: Illegal invocation
at Object.fetch (/path/src/index.js:59:5)
at __facade_modules_fetch__ (/tmp/tmp-778150-oye4YPdtwnN2/middleware-loader.entry.ts:46:16)
at __facade_invokeChain__ (/path/node_modules/wrangler/templates/middleware/common.ts:53:9)
at Object.next (/path/node_modules/wrangler/templates/middleware/common.ts:50:11)
at jsonError (/path/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:30)
at __facade_invokeChain__ (/path/node_modules/wrangler/templates/middleware/common.ts:53:9)
at __facade_invoke__ (/path/node_modules/wrangler/templates/middleware/common.ts:63:9)
at Object.fetch (/tmp/tmp-778150-oye4YPdtwnN2/middleware-loader.entry.ts:114:11)
wrangler version 3.2.0 and 3.3.0. In this example I'm just running a resolve, running anything else the promise will run but the worker will die anyway
export default {
fetch: async (request, env, { waitUntil }) => {
waitUntil(Promise.resolve())
return new Response('hello')
}
}
export default {
fetch: async (request, env, { waitUntil }) => {
waitUntil(Promise.resolve())
return new Response('hello')
}
}
am I doing something wrong?
3 replies
CDCloudflare Developers
Created by o0th on 2/15/2023 in #workers-help
worker routes in wrangler.toml
I'm having troubles understanding how routes works This works
routes = [{ pattern = "*/assetscdn/*", zone_id = "<zone_id>" }]
routes = [{ pattern = "*/assetscdn/*", zone_id = "<zone_id>" }]
This doesn't work ✘ [ERROR] Could not find zone for assetscdn
routes = [{ pattern = "*/assetscdn/*", zone_name = "<zone_name>" }]
routes = [{ pattern = "*/assetscdn/*", zone_name = "<zone_name>" }]
This doesn't work Route pattern may only contain wildcards at the beginning of the hostname and the end of the path: <domain>/*/assetscdn/*
routes = [{ pattern = "<domain>/*/assetscdn/*", zone_name = "<zone_name>" }]
routes = [{ pattern = "<domain>/*/assetscdn/*", zone_name = "<zone_name>" }]
This doesn't works ✘ [ERROR] Invalid URL
routes = [
{ pattern = "*", zone_id = "<zone_id>" },
{ pattern = "*/*", zone_id = "<zone_id>" }
]
routes = [
{ pattern = "*", zone_id = "<zone_id>" },
{ pattern = "*/*", zone_id = "<zone_id>" }
]
This work
routes = [
{ pattern = "*", zone_name = "<zone_name>" },
{ pattern = "*/*", zone_name = "<zone_name>" }
]
routes = [
{ pattern = "*", zone_name = "<zone_name>" },
{ pattern = "*/*", zone_name = "<zone_name>" }
]
Is there an implementation difference or I'm missing something?
9 replies