Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

Any way to get project code from workers deployed version

Hey guys by mistake I lost my project repo from my laptop and latest version was not on github too. But its running in workers. It was hono app deployed with workers. So is there any way to get the code from workers by any way.

Is there any way to deploy directly to my customer's CF account without using an API key?

Something like SSO? Background: I'm build a proprietary CF worker app and want to deploy it via wrangler directly to customer's account...

Can't create secrets or env variables?

I created a worker and deployed via wrangler and everything functions as expected. A colleague created another worker using the same mechanism, but for some reason we both get permissions errors when trying to create any secrets or variables for it. Nothing on the permissions side has changed. Is it possible there is a setting in the wrangler.toml I am missing?

Vite with WorkerEntrypoint (RPC)

I'm trying to run Hono app on Vite as Cloudflare Worker. I'm using @cloudflare/vite-plugin and I'm getting following error when vite serve: Worker "core:user:minerva-gateway"'s binding "AUTH_SERVICE" refers to a service "core:user:minerva-auth", but no such service is defined. The problem might be because I use WorkerEntrypoint (to enable RPC), does Vite support it? If so, where should I define the service?...

Issue with Workers / Nuxt / D1 via Drizzle

Hi, When I deploy my app to cloudflare workers, I get a 500 error when retrieving data from my database on initial load, if I use the refresh method to get the data again it works fine. Locally works fine on page load. This is how I am using drizzle:...

Shifting to workers from pages

We're looking into workers as an alternative to pages, and have a couple of compatibility questions - / 1. We have prod/preview env settings in pages, i cannot find the equivalent settings on workers. How do i set different env variables/secrets in prod/preview workers? 2. We get branch preview urls on pages, but for workers, it seems to change per commit. Is there a way to have a common branch deployment url for workers?...

Workers API responding very slow (>2 seconds for simple APIs, >20s for others)

I deployed a CF worker binded with a D1 database. I know about the cold start delay, but all my APIs are taking approx. 2 second each. I have an API to fetch 150 product data. That takes 20+ seconds. I optimized it to use batch queries and everything. I did EXPLAIN QUERY and the query itself takes 20ms. ...
No description

Workers-specific command in a Pages project

No matter how I try and deploy my project I keep getting stopped at the last step. I am using the GitHub integration and have set my CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN under Variables and Secrets in the Settings tab of my worker. I've also tried to check and it appears I am in a workers project NOT a pages one. But every time I build it goes through everything and then fails right at the end with a message that says something to the effect of 23:39:50.481 ✘ [ERROR] It looks like you've run a Workers-specific command in a Pages project. 23:39:50.482
23:39:50.482 For Pages, please run wrangler pages deploy instead....

Having Trouble Getting D1 to Work in Local Development with Drizzle ORM?

Everything works fine when I run drizzle migrate or use Drizzle Studio. Oddly enough, D1 also works perfectly after deploying to a Worker. However, it doesn't function in local development mode. For context, I'm using React Router v7 along with the Wrangler Vite plugin. Any ideas or suggestions would be greatly appreciated!...
No description

Build Failed: error occurred while installing tools or dependencies

10:34:57.303 Initializing build environment... 10:35:04.164 Success: Finished initializing build environment 10:35:04.984 Cloning repository... 10:35:10.969 Detected the following tools from environment: [email protected], [email protected] 10:35:10.970 Installing nodejs 23.11.0...

wrangler.jsonc alternate "main" entrypoint in Vite Project

Hi, in a Vite React project deployed to Cloudflare Workers, created using pnpm create cloudflare@latest, I'm just curious if it's possible to set the "main" value in a project's wrangler.jsonc file to something other than the default "worker/index.ts" entrypoint. For example, if I want to setup a Hono API, can I change the entrypoint to "src/server/index.ts"? Logically, that feels doable, but is there anything else I need to do to keep Typescript happy and make sure my types generated by `work...

pnpm: EMFILE: too many open files

Hey everyone, I'm encountering an error while trying to build my monorepo project using Cloudflare Workers and the github integration. ``` 22:56:30.085 pnpm: EMFILE: too many open files, open '/opt/buildhome/repo/apps/server/node_modules/esbuild-register/package.yaml' 22:56:30.085 at async open (node:internal/fs/promises:638:25)...

Durable Objects Deployment Error

I expirience some issues in my CD (gh actions) with wrangler deployment of worker with durable objects. First deployment is always ok, but then any further updates fail with error:
Cannot apply new-sqlite-class migration to class 'BattleDurableObject' that is already depended on by existing Durable Objects
Cannot apply new-sqlite-class migration to class 'BattleDurableObject' that is already depended on by existing Durable Objects
i do not remove this migration form my wrangler.toml config. Docs say that for any further code updates of the DO executing wrangler deploy is sufficient. Have anyone faced this issue before? Also i am considering, if there are anything like local state based on which wrangler determines if it should run migrations or not?...

Missing `waitUntil` option -- what's that?

As per subject. I keep seeing that message in Workers Logs (I enabled observability) for my queues. My queue is running Browser Rendering

Build failing with ENOSPC: no space left on device for monorepo project on Cloudflare Workers Build.

Hi everyone, I'm encountering an error while trying to build my monorepo project using Cloudflare Workers Builds. The build process fails during the yarn install --production step with multiple "ENOSPC: no space left on device" errors. Build Command:...

Dependency Conflict in Next.js Cloudflare Template during npm install

Hey everyone, I'm using the Next.js Cloudflare template and trying to deploy using these settings: Build command: npm install --force ...

Failed to deploy - authentication issue during secrets pull

Hey I didn't have scope on the token for secrets store read. However, I added it and my CI job failed anyway. Does permissions scope have some lag on it which I have to wait?...

Fetch question

I developed a worker that fetches mirror page from another domain addEventListener('fetch', function(event) { event.respondWith(handleRequest(event.request)) // handleRequest is my own async function });...

R2 seems to be ignoring the CORS policy

I have a bucket that i'm trying to upload to via signed URLs generated using aws-sdk Node package The signed URL always fails PUT request with Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Here's my CORS policy, which should work? What am I missing? ...