veeque
veeque
Explore posts from servers
DTDrizzle Team
Created by veeque on 4/19/2025 in #help
How to handle multiple Durable Objects (with different schemas and migrations)
Is there a way to kind of have two Drizzle "projects" in one? I want to have two sets of schemas, and two of everything such that I can all one set of migrations on one Durable Object, and another on another Durable Object. This is because one worker allows for multiple Durable Objects to be defined and used
1 replies
CDCloudflare Developers
Created by veeque on 4/16/2025 in #workers-help
ETA for being able to set watch paths in `wrangler.jsonc`?
To configure watch paths for Workers Builds (https://developers.cloudflare.com/workers/ci-cd/builds/build-watch-paths/) I have to use the dashboard. The config for it (https://developers.cloudflare.com/workers/wrangler/custom-builds/) is currently not honored (https://developers.cloudflare.com/workers/ci-cd/builds/configuration/). Is there an ETA for when that config option is going to be honored?
1 replies
CDCloudflare Developers
Created by veeque on 4/15/2025 in #workers-help
`wrangler types` uses generic type for `DurableObjectNamespace`
I have a Worker with the default being the extended WorkerEntrypoint and a DurableObject DO. runnign wrangler types gives:
declare namespace Cloudflare {
interface Env {
MY_DURABLE_OBJECT: DurableObjectNamespace /* MyDurableObject */;
}
}
declare namespace Cloudflare {
interface Env {
MY_DURABLE_OBJECT: DurableObjectNamespace /* MyDurableObject */;
}
}
So clearly it knows even the name of the DO, just refuses to put it as DurableObjectNamespace<MyDurableObject>
10 replies
CDCloudflare Developers
Created by veeque on 4/15/2025 in #workers-help
Know commit hash of running worker
When the worker is deployed I would like to have a way for the worker to know what is the commit version that was used to build/ship it. Kind of like having an env var that stores the output of git rev-parse HEAD that i can just reference in the worker's code itself.
4 replies
CDCloudflare Developers
Created by veeque on 4/14/2025 in #pages-help
How do I reinstall the git integration?
No description
2 replies
CDCloudflare Developers
Created by veeque on 3/31/2025 in #workers-help
Environments best practices
With workers I can have a "default" environment (placing things in the root of the wrangler.jsonc, and n environments such as development. What's better: having the "default" be the production one with the development one being specified as a separate env (requiring me to add -e development when using that), or having the "default" one be the development, with the prod being its own env?
3 replies
CDCloudflare Developers
Created by veeque on 3/28/2025 in #workers-help
Preview deployments non a thing with Assets?
With Pages I could just push to another branch and that got its own .pages.dev URL. Doing the same with Workers Assets doesn't give me such URL, so... how can I get a preview deployment?—say that of the dev branch
8 replies
CDCloudflare Developers
Created by veeque on 3/27/2025 in #workers-help
Build rust workers
Using the git integration it complains that cargo is not found. Is this a limitation of the git integration?
3 replies
CDCloudflare Developers
Created by veeque on 3/26/2025 in #workers-help
Cannot deploy Worker Assets
No description
18 replies
CDCloudflare Developers
Created by veeque on 3/25/2025 in #pages-help
In SvelteKit do I have to use `wrangler dev` instead of `vite dev` to make service bindings work?
I have two SvelteKit projects, both running on Pages. Project B has a service binding to Project A but it only works if Project A is running the preview script (which contains wrangler dev), and not when using the dev script (vite dev). Is this a "hard" limit or is there a way to make service bindings work with the "normal" dev mode?
4 replies
CDCloudflare Developers
Created by veeque on 3/20/2025 in #pages-help
Image transform with SvelteKit
So, I put the images in the assets folder, but how do I use cloudflare's image transformation now? Say i have pic.jpg in assets/pic.jpg, visible on https://my-page.pages.dev/pic.jpg. doing https://my-page.pages.dev/cdn-cgi/image/width=80,quality=75/pic.jpg doesn't return anything... how is this supposed to work?
1 replies
CDCloudflare Developers
Created by veeque on 3/20/2025 in #pages-help
Is there a build time limit?
i got this after 3 mins (builds locally)
20:11:54.983  ELIFECYCLE  Command failed with exit code 139.
20:11:55.006 Failed: Error while executing user command. Exited with error code: 139
20:11:55.016 Failed: build command exited with code: 1
20:11:56.157 Failed: error occurred while running build command
20:11:54.983  ELIFECYCLE  Command failed with exit code 139.
20:11:55.006 Failed: Error while executing user command. Exited with error code: 139
20:11:55.016 Failed: build command exited with code: 1
20:11:56.157 Failed: error occurred while running build command
14 replies
CDCloudflare Developers
Created by veeque on 2/3/2025 in #general-help
How do image transformations work? (SvelteKit + unpic)
I have a SvelteKit app, and place the images inside the assets folder. Then, using unpic, it should (but doesn't) fetch from some cf-specific url to transform the images. This doesn't happen and I have no idea how to actually make it work.
1 replies
CDCloudflare Developers
Created by veeque on 1/29/2025 in #pages-help
What's the difference between Cloudflare Pages and Workers Frameworks?
Basically, when making an app, which should I choose and why? The line between them is really blurry.
14 replies
HHono
Created by veeque on 1/27/2025 in #help
What is the difference between `Zod OpenAPI` and `Hono OpenAPI`?
From reading the docs I can't tell why I should use one as opposed to the other. Can I use both? If so, how?
15 replies
DTDrizzle Team
Created by veeque on 1/21/2025 in #help
What is the recommended way to have a staging and a production environment?
For the record, I'm using Cloudflare D1. I know how to set up the wrangler.json file such that based on the environment I use a different database (same binding, just different database IDs). How can I make it so the drizzle.config.ts file uses a different .env file based on the environment being used?
4 replies
CDCloudflare Developers
Created by veeque on 1/20/2025 in #workers-help
Defining RPC methods nicely
Since the methods are pretty big it's nicer to define them in a separate file, but then to add them as RPC methods I do:
export default class Worker extends WorkerEntrypoint {
fetch(request: Request) {
return app.fetch(request);
}

hello() {
return hello();
}
}
export default class Worker extends WorkerEntrypoint {
fetch(request: Request) {
return app.fetch(request);
}

hello() {
return hello();
}
}
Will I really have to define them all by using that "dumb" "self"-call? Also, since I'll likely want the HTTP api to just call the same method instead of having two places that refer to the same function it'd be nice to have it so I have a single source of truth, making the code:
export default class Worker extends WorkerEntrypoint {
fetch(request: Request) {
return app.fetch(request);
}

static hello() {
return hello()
}

hello() {
return Worker.hello();
}
}
export default class Worker extends WorkerEntrypoint {
fetch(request: Request) {
return app.fetch(request);
}

static hello() {
return hello()
}

hello() {
return Worker.hello();
}
}
Seems pretty big considering one could (if this didn't have to be a class):
const myMethods = {
hello,
}
const myMethods = {
hello,
}
2 replies
CDCloudflare Developers
Created by veeque on 1/18/2025 in #workers-help
Can Worker Routes be used to host a separate backend on the same domain where the web app is hosted?
Say we have domain.com where on app1.domain.com we host our app. This app has a front-end you'd access by going to app1.domain.com (or any other sub-domain like app1.domain.com/my/route). The web-app, a mobile app, or a third-party service might need to fetch data, ideally from app1.domain.com/api/requested/resource. Can I host the front-end with Workers/Pages on—by default—all routes on that subdomain, but "reserve" /api/* to be used by a separate worker running the backend code?
3 replies
CDCloudflare Developers
Created by veeque on 1/9/2025 in #workers-help
Is the Workers Build watch path based off the root directory?
No description
5 replies
HHono
Created by veeque on 1/7/2025 in #help
Best way to export types for use in a separate app with `hc` client
I have a monorepo where one folder contains the Hono app, and another a SvelteKit one. How best do I make the type available to the SvelteKit project for use with the hc client?
5 replies