xeon06
Explore posts from serversCDCloudflare Developers
•Created by xeon06 on 10/12/2024 in #workers-help
API to set worker environment variable?
Hey folks,
I'm looking for an HTTP API to set a Worker's environment variable. Digging into Wrangler, another member of the community found this for secrets:
/accounts/account_id/workers/scripts/script_name/secrets
https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/secret/index.ts#L170-L185
But I'm not sure if it can apply to regular plain text env vars, and am not finding anything else documented anywhere.
3 replies
CDCloudflare Developers
•Created by xeon06 on 10/9/2024 in #workers-help
Service binding RPC method null
I have a project with a service binding I call like this:
Despite the service being bound correctly, I ge this in production:
Logging this
Gives
I can rewrite it using
fetch
, but are these supposed to work?8 replies
CDCloudflare Developers
•Created by xeon06 on 10/9/2024 in #pages-help
Debugging service binding
Hey folks, I have a service binding I call like this:
The service is bound on my pages project, but I get this:
I can confirm the
encrypt
method is on the class when I do edit code. I'm kind of at a loss for what else to try.3 replies
CDCloudflare Developers
•Created by xeon06 on 10/8/2024 in #workers-help
Set secrets via HTTP
Is there any way to set a worker secret via HTTP? I see there's something for Worker Platform but not finding much for workers except for the wrangler command, but I want to do it through code...
3 replies
CDCloudflare Developers
•Created by xeon06 on 10/1/2024 in #workers-help
Durable opbject bindings?
Do durable objects need to be bound through the dashboard? There's a space for it, but I have no dur
1 replies
CDCloudflare Developers
•Created by xeon06 on 9/7/2024 in #workers-help
Setting DO script_name only in dev?
Hey folks, in order to work with Durable Objects with
getPlatformProxy
, you must use a separate worker and script_name
. That's all fine, but is there a way to ensure the script_name
is only set in dev, since that seems to have an effect in prod too?
1 replies
CDCloudflare Developers
•Created by xeon06 on 9/5/2024 in #workers-help
RPC dispose not available?
Hey folks, I'm calling an RPC worker locally from a Cloudflare Astro project, 11.0.4 on the CF Astro adapter, Wrangler 3.74.0
When I call an RPC method, I get this:
An RPC stub was not disposed properly. You must call dispose() on all stubs in order to let the other side know that you are no longer using them. You cannot rely on the garbage collector for this because it may take arbitrarily long before actually collecting unreachable objects. As a shortcut, calling dispose() on the result of an RPC call disposes all stubs within it.However there is nothing on
dispose
or [Symbol.dispose]
for me to call, both are undefined. Am I in version incompatibility hell?2 replies
DTDrizzle Team
•Created by xeon06 on 8/14/2024 in #help
D1 Blobs as ArrayBuffer?
Hey folks, I'm trying to store ArrayBuffers in D1 as Blobs. This Cloudflare page seems to indicate that D1 will automatically do the marshalling of blobs <> ArrayBuffers
https://developers.cloudflare.com/d1/build-with-d1/d1-client-api/#type-conversion
But I am just getting plain number arrays back unless I use a custom type:
It feels like doing this operation on every query will be slow, so I'm wondering if there's another way to get an ArrayBuffer out of this whole thing?
1 replies
CDCloudflare Developers
•Created by xeon06 on 8/12/2024 in #workers-help
RPC + cron?
Hey folks, I'm trying to add RPC to a worker that already has a scheduled handler for cron. It looks like inheriting from WorkerEntrypoint messes up any other method such as
scheduled
..?3 replies
Using HonoX with React and react-three-fiber
Hey all, I think I may be attempting something a little too tricky. I'm trying to make a HonoX project with a client-only island that uses react-three-fiber. A base install gives this error when hitting the page:
Adding
@react-three/fiber
to ssr.external
however then results in:
Seems like either won't work, anyone has an idea?2 replies
CDCloudflare Developers
•Created by xeon06 on 2/1/2024 in #workers-help
WebAssembly.instantiate(): Wasm code generation disallowed by embedder
Hey folks,
I'm trying to get a Wasm library to work in a Pages function, but I'm having the hardest time instantiating it.
At first I was fetching the .wasm binary to instantiate, but someone in #pages-help told me it had to be bundled within the _worker.js script. Okay, now it's a UInt8Array directly in the _worker.js script but I still get this error.
Is there more information on how the wasm binary should be bundled? Is it a specific format that will make the CF worker accept it?
15 replies
CDCloudflare Developers
•Created by xeon06 on 2/1/2024 in #pages-help
Deployment failure logs
2 replies
CDCloudflare Developers
•Created by xeon06 on 1/31/2024 in #pages-help
CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder
Hey folks,
I'm trying to run a wasm file compiled by emscripten on CF workers. It's working fine locally, but when I try it in production I get:
This page seems to indicate that
WebAssembly.instantiate
should work, am I missing something?
https://developers.cloudflare.com/workers/runtime-apis/webassembly/13 replies
CDCloudflare Developers
•Created by xeon06 on 1/15/2024 in #pages-help
Accessing assets from pages functions
Hey folks, I'm building an app on Pages using the CloudFlare Astro adapter. I'm trying to access some of my static assets in a function, but
Astro.locals.runtime.env.ASSETS
seems to be undefined
, both in directory or advanced mode. Does anyone know if there's any extra bits of config I need to do or?10 replies
DTDrizzle Team
•Created by xeon06 on 1/12/2024 in #help
Update with inner join?
Hey folks, is it possible to do an update with an inner join in order to have more complicated filter logic, with values coming from other tables, for our
where
?14 replies
DTDrizzle Team
•Created by xeon06 on 1/9/2024 in #help
Shifted properties in join
I'm getting some very strange join behavior. This query:
Returns a proper transaction, but the
inboxes
object is completely out of whack, missing some properties but also a lot of the properties are shifted:
It should be:
Tried with one other table and same result as well, weird shifted properties in the joiend table2 replies
DTDrizzle Team
•Created by xeon06 on 1/9/2024 in #help
Select fields with the same name in two different tables in a join
Is it possible to select two fields of the same name, but from a different table, as part of a join? e.g.
As-is, it only ever gives me one of two
currencyCode
fields, even if they are technically renamed by the partial select
2 replies
DTDrizzle Team
•Created by xeon06 on 1/3/2024 in #help
String default for integer timestamps?
Hey folks, I'm using Drizzle with SQLite on CloudFlare D1. Using the following column schema:
From the D1 database viewer I am seeing that Drizzle creates values that look like this
2024-01-03 03:55:45
, whereas values inserted via direct SQL are integers properly e.g. 1703894400
. In addition, the string values show up as NULL
in Drizzle Studio. Could I be doing something wrong or have I encountered a bug?9 replies
CDCloudflare Developers
•Created by xeon06 on 12/18/2023 in #workers-help
Email worker inside of a pages repo?
Hey folks,
I'm trying to develop something that uses both pages for deployment of a frontend / backend website, but also an email worker. I want to try to keep the code in the same repo, but I realize that it will need to be separate deployments on CloudFlare, since pages doesn't support email routing. Are there existing patterns to keep both my pages and my email worker's code in the same repo while still being able to deploy everything?
5 replies