cj
cj
CDCloudflare Developers
Created by cj on 10/7/2024 in #workers-help
I'm trying to build ffmpeg.wasm for CF worker. Need help
I am trying to build a custom version of ffmpeg.wasm for CF worker.
10 replies
CDCloudflare Developers
Created by cj on 6/13/2024 in #workers-help
What is the environment variable load order for wrangler.dev & env.vars?
If I have env vars defined in wrangler.toml and env.vars which is picked and which is overridden? For example this is NextJS' environment variale load order: Environment variables are looked up in the following places, in order, stopping once the variable is found. 1. process.env 2. .env.$(NODE_ENV).local 3. .env.local (Not checked when NODE_ENV is test.) 4. .env.$(NODE_ENV) 5. .env
1 replies
CDCloudflare Developers
Created by cj on 6/5/2024 in #workers-help
Failing to use wrangler secret list
pnpm wrangler secret list
✘ [ERROR] A request to the Cloudflare API (/accounts/ed77d12fd9fc5faef08d17e41fdb2dc5/workers/scripts/project-name/secrets) failed.
workers.api.error.script_not_found [code: 10007]
pnpm wrangler secret list
✘ [ERROR] A request to the Cloudflare API (/accounts/ed77d12fd9fc5faef08d17e41fdb2dc5/workers/scripts/project-name/secrets) failed.
workers.api.error.script_not_found [code: 10007]
1 replies
CDCloudflare Developers
Created by cj on 6/5/2024 in #workers-help
Should `unsafe.bindings.ratelimit` have different `namespace_id` for each worker environment?
Lets say I have
[[unsafe.bindings]]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1001"
[[unsafe.bindings]]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1001"
Do I need to have different namespace_id for each environment? If so how do we do it? I tried
[env.dev.unsafe.bindings]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1002" # Dev namespace ID
simple = { limit = 10, period = 60 }

[env.staging.unsafe.bindings]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1003" # Staging namespace ID
simple = { limit = 10, period = 60 }

[env.production.unsafe.bindings]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1004" # Production namespace ID
simple = { limit = 10, period = 60 }
[env.dev.unsafe.bindings]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1002" # Dev namespace ID
simple = { limit = 10, period = 60 }

[env.staging.unsafe.bindings]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1003" # Staging namespace ID
simple = { limit = 10, period = 60 }

[env.production.unsafe.bindings]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1004" # Production namespace ID
simple = { limit = 10, period = 60 }
But I get the error
{"name":"RATE_LIMITER","type":"ratelimit","namespace_id":"1002","simple":{"limit":10,"period":60}} is not of type "array"
3 replies
CDCloudflare Developers
Created by cj on 6/4/2024 in #workers-help
Impossible to add a new ENV Variable if using unstable.bindings.RATE_LIMITER
Already asked here: https://community.cloudflare.com/t/new-rate-limiting-binding-impossible-to-add-new-env-variables/659433 What is the couse of action? Delete the project and redeploy?
4 replies
CDCloudflare Developers
Created by cj on 5/13/2024 in #workers-help
[solved] How to upload vars along with a wrangler deployment
I know we can use .dev.vars for local development. But how do I set the env vars for production and development deployment? I can't add them to wrangler.toml as it gets commited to git.
3 replies
CDCloudflare Developers
Created by cj on 5/13/2024 in #workers-help
How to wrangler deploy a dev worker?
I would like to deploy two workers, one for production (which would have a custom domain) and a dev worker with no custom domain.
3 replies
CDCloudflare Developers
Created by cj on 5/13/2024 in #workers-help
Failure in deploying ratelimit - must have `namespace_id` even though it is defined in wrangler.toml
Here is my wrangler.toml
[[unsafe.bindings]]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1001"
simple = { limit = 10, period = 10 }
[[unsafe.bindings]]
name = "RATE_LIMITER"
type = "ratelimit"
namespace_id = "1001"
simple = { limit = 10, period = 10 }
I get the error even though I have defined namespace_id. I get this error when I try updating the environment variables. Note: I deployed using wrangler deploy --minify src/index.ts and I'm using hono.dev
binding RATE_LIMITER of type ratelimit must have an namespace_id specified (Code: 10021)
Am I seeing an error because I already used the namespace_id previously? I assumed this and deleted my old worker project. But I still get this error.
2 replies
CDCloudflare Developers
Created by cj on 4/30/2024 in #workers-help
How to create a worker that can only be called from other workers - pages app calling service bindin
I have a next js app I host on cloudflare pages and a hono.dev app. I wish to service bind the hono app to the next js app. But don't want the hono app to be externally accessible.
2 replies
CDCloudflare Developers
Created by cj on 4/9/2024 in #general-help
[Solved] Error while running get started code using Browser Render API - Screenshot
No description
3 replies
CDCloudflare Developers
Created by cj on 3/23/2024 in #general-help
[workers] CPU time limit unclear
In the workers limits page link it is mentioned for the standard plan the CPU time limit is 30s for a HTTP request. Questions 1. New paid plans will fall under the Standard Plan, right? 2. Does a 30s CPU time mean I can expect the worker to run for atleast 30 seconds? I plan to run a high compute image processing worker and will need it to run for a few seconds
3 replies