Jeremy Evans
Jeremy Evans
CDCloudflare Developers
Created by Jeremy Evans on 6/3/2024 in #workers-help
Workers Routes not adding DNS records, URL returns DNS_PROBE_FINISHED_NXDOMAIN
Sorry for the very late reply @Chaika but just to say, using Custom Domains worked a treat - thank you!
5 replies
CDCloudflare Developers
Created by Jeremy Evans on 3/24/2023 in #workers-help
My KV binding is not being set by my wrangler.toml file when deploying to my production environment
Thanks @sapkotamadan , I was aware of that, and was doing exactly that, but the production one was not binding (even though the development one was working). However, I tried removing the preview and then production worked! So thanks for your help. Cloudflare definitely need to update their docs to make it clear that KV bindings will break if you include a preview in your production settings.
6 replies
CDCloudflare Developers
Created by Jeremy Evans on 3/24/2023 in #workers-help
My KV binding is not being set by my wrangler.toml file when deploying to my production environment
6 replies
CDCloudflare Developers
Created by Jeremy Evans on 3/24/2023 in #workers-help
My KV binding is not being set by my wrangler.toml file when deploying to my production environment
Thank you very much @sapkotamadan ! I'll try that on our next deploy.
6 replies
CDCloudflare Developers
Created by Jeremy Evans on 1/23/2023 in #queues
Hey folks Heavy Cloudflare Workers user
Thanks anyway for your help!
13 replies
CDCloudflare Developers
Created by Jeremy Evans on 1/23/2023 in #queues
Hey folks Heavy Cloudflare Workers user
Oh interesting - when I try it outside the dashboard sandbox environment it works! So it's just inside the Quick Edit sandbox that it doesn't have the binding.
13 replies
CDCloudflare Developers
Created by Jeremy Evans on 1/23/2023 in #queues
Hey folks Heavy Cloudflare Workers user
Sadly not, I get:
TypeError: Cannot read properties of undefined (reading 'send')
at Object.fetch
TypeError: Cannot read properties of undefined (reading 'send')
at Object.fetch
13 replies
CDCloudflare Developers
Created by Jeremy Evans on 1/23/2023 in #queues
Hey folks Heavy Cloudflare Workers user
No description
13 replies
CDCloudflare Developers
Created by Jeremy Evans on 1/23/2023 in #queues
Hey folks Heavy Cloudflare Workers user
I created it in wrangler (but have tried modifying it using the dashboard too)
13 replies
CDCloudflare Developers
Created by Jeremy Evans on 1/23/2023 in #queues
Hey folks Heavy Cloudflare Workers user
The console log prints out {TEST_VAR: "TEST_VALUE"} so the regular env variable is there but not the queue
13 replies
CDCloudflare Developers
Created by Jeremy Evans on 1/23/2023 in #queues
Hey folks Heavy Cloudflare Workers user
Here's my worker:
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
console.log("env", env);

let log;
log = await request.json();
await env.ANALYTICS_EVENTS_QUEUE.send(log);
return new Response("Success!");
},

async queue(batch: MessageBatch<Error>, env: Env): Promise<void> {
let messages = JSON.stringify(batch.messages);
console.log(`Consumed from our queue: ${messages}`);
},
};
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
console.log("env", env);

let log;
log = await request.json();
await env.ANALYTICS_EVENTS_QUEUE.send(log);
return new Response("Success!");
},

async queue(batch: MessageBatch<Error>, env: Env): Promise<void> {
let messages = JSON.stringify(batch.messages);
console.log(`Consumed from our queue: ${messages}`);
},
};
13 replies
CDCloudflare Developers
Created by Jeremy Evans on 1/23/2023 in #queues
Hey folks Heavy Cloudflare Workers user
⛅️ wrangler 2.8.1
13 replies
CDCloudflare Developers
Created by Jeremy Evans on 1/23/2023 in #queues
Hey folks Heavy Cloudflare Workers user
Here's my wrangler.toml file:
name = "savvy-queues"
main = "src/index.ts"
compatibility_date = "2023-01-23"

[vars]
TEST_VAR = "TEST_VALUE"

[[queues.producers]]
queue = "analytics-events-queue"
binding = "ANALYTICS_EVENTS_QUEUE"

[[queues.consumers]]
queue = "analytics-events-queue"
max_batch_size = 10
max_batch_timeout = 5
name = "savvy-queues"
main = "src/index.ts"
compatibility_date = "2023-01-23"

[vars]
TEST_VAR = "TEST_VALUE"

[[queues.producers]]
queue = "analytics-events-queue"
binding = "ANALYTICS_EVENTS_QUEUE"

[[queues.consumers]]
queue = "analytics-events-queue"
max_batch_size = 10
max_batch_timeout = 5
13 replies