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

Encountering Issues with Next.js, Wrangler, and OpenNext Integration ([ERROR] Could not resolve "XX"

Hi everyone, I'm encountering an issue while trying to run a Next.js project on Cloudflare Workers. Here's my setup: Next.js: 14.2.5...
No description

I am not able to enter the prompt after cloning the git hub repo

after cloning and delploying the git hub repo for this image generation app, the app does show the file to enter the prompt for image generations ...

Hi guys!

Can somebody publish an example of how to upload an ES module worker by API please? The official documentation is not very clear, at less for me. I'm expecting Unexpected token 'export' issues 😒 Because I'm not being able to set correctly the type to ES Module. Already tried setting: - In the header: "CF-WORKER-MAIN-MODULE-PART": "worker.mjs"...

Migrating to ES Modules

I have a fairly large project written with the Service Worker syntax. Because of this I'm using the global variables for bindings and environment variables in a lot of places. Can I use something like AsyncLocalStorage with the nodejs_compat flag to prevent a large code rewrite? Is there any performance implications to this or redflags I should be aware of?

Your worker exceeded 1mb

Error: Failed to publish your Function. Got error: Your Worker exceeded the size limit of 1 MiB. Refer to the Workers documentation (https://developers.cloudflare.com/workers/observability/errors/#errors-on-worker-upload) for more details.
Error: Failed to publish your Function. Got error: Your Worker exceeded the size limit of 1 MiB. Refer to the Workers documentation (https://developers.cloudflare.com/workers/observability/errors/#errors-on-worker-upload) for more details.
How do I check this? Can I build it locally and check somehow if it is reaching 1MB? How can I check it locally on my machine? And what exactly is it talking about by mentioning 1MB? I have an astro app deployeed....

Discord bot stack question

I want to create a Discord Bot that, after typing in a description of a dream school, finds the most fitting one in the database and displays the data to the user on Discord. I would like the backend and database to be in Poland and the whole infrastructure to be as fast and light as possible. I can TS, use BUN and am thinking about Hono. What do you think about most efficient stack in this case?...

Smart Placement not working

Worker smart placement not working "zoneless_workers.workers_table.smart_placement.status.tooltip.unsupported_application" the application takes huge times to respond. The response time used to be sub 1-1.5s with smart placement previously but suddenly smart placement has stopped working which causes long delays (~10s) in response. Running on free tier...

Are There Ongoing Network Issues in Asia, Specifically in India or Singapore?

My workers are experiencing unusual issues. Some of them have been facing problems handling fetch requests since yesterday. I had to redeploy them without making any changes, which temporarily resolved the issue. Could there have been any infrastructure changes affecting requests made to other workers.dev on different account from within a workers.dev domain?...

Workers running in a different continent from the requester

I'm in Brazil, my result for https://www.cloudflare.com/cdn-cgi/trace is fl=97f585 h=www.cloudflare.com ip=2804:7f4:REDACTED ts=1732064404.743...

Redundant wrapper in schema created by cli?

In a Cloudflare worker project created from cli, I get a hono server created, and the response to TaskFetch endpoint is described with this openApi schema: ``` responses: { "200": { description: "Returns a single task if found",...

workers.dev domains have suddenly gone offline

we're an enterprise client and all of our workers that don't have custom hostnames, accessed via [scope].workers.dev domains are returning 'There is nothing here yet'

cloudflare worker not triggered on a route

I have a cloudflare worker but it's not triggered on a route I configured. ``` routes = [ { pattern = "myapp/resources-v2/*", zone_id = "abc123"} ]...

Error deploying worker with ~40 routes, code 10013 .

I'm stumped by this, just posted here: https://community.cloudflare.com/t/error-deploying-worker-with-40-routes-code-10013/737938 Limits page says something like 1,000 routes per domain so I don't think it's a limit issue. Also the CLI takes FOREVER to deploy with this many routes...

Where's the best place to ask about / suggest features for wrangler?

In case it's here, my thought was: There doesn't seem to be any checks for missing environment variables/secrets on wrangler deploy, which feels like a missed opportunity... I might be missing something obvious, but presumably once built, the code could be scanned for environment variables/secrets and any instances could be checked against wrangler.toml and the production worker (if it exists), to ensure that no variables/secrets are missing. If there are any missing variables/secrets, the deployment could then fail and provide feedback....

How to return a plain object and not a stub from a Worker with RPC binding?

I'm working with a Cloudflare Worker that is called from a Cloudflare Pages project using Services Binding + RPC. I'd like to be able to configure or convert a plain object returned from a target instance to be serialized to an object and not be returned as a stub. As an example, consider the following projects: TYPE LIB: Standalone library with types I want to reference in other projects....

How would you force a worker custom domain to open in https?

Hi y'all, I pointed my worker to preview.mydomain.com, but when I open that in my browser it defaults to http. Is there a way to always open in https? The DNS config is uneditable because I've set it from the worker as a custom domain.
No description

Provision secrets from the command line

Hello. I'd like to be able to provision secrets on Cloudflare conveniently. I'd like to do npx wrangler secret put <KEY> for example and for Wrangler to get the key from .dev.vars? I don't want to paste the key into the keyboard or type it in. How do you solve this workflow problem? Or maybe I'm missing something?...

npx wrangler kv:key put test4... -local --persist-to worker-local

Hello. Doing npx wrangler kv:key put test4 0123456 --binding MY_KV_NAMESPACE --local --persist-to worker-local gives : ...

Configuration file for Pages projects does not support "observability"

I'm trying to get my worker project working with observability via the documentation ``` compatibility_date = "2024-11-12" ...

websocket client in workers / durable object

wondering if it makes sense to build a websocket consumer in a worker / durable object setting. Specificallly, I'm interested in receiving messages from the bluesky jetstream https://skyware.js.org/guides/jetstream/introduction/getting-started/
Next