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

Fetch inside a worker fails if the worker is invoked via a Pages function binding

hi folks šŸ‘‹ I have a problem with a worker that's invoked from a Pages function via bindings, and I'd appreciate some help. The worker is pretty simple, it uses fetch to download a JSON file, and then it responds with some data. When in call the worker directly using curl, it works as expected. However, when I call it using a Service binging from a Pages function, I get an error because the JSON file is invalid: ```...

Function not updating

I deployed a static site to Pages and am now trying to use Functions to authenticate Decap CMS with Gitlab OAuth. I placed the OAuth handling functions in functions/auth. After deploying them the first time there were some things that needed fixing, but it seems like only the first version of the functions is now used, although every new build log states: ``` 20:18:42.379 Found Functions directory at /functions. Uploading. 20:18:42.385 ā›…ļø wrangler 3.101.0...

Pages Repository Limit

Hello. I am hitting the same issue discussed in this thread: https://discord.com/channels/595317990191398933/1351610490069057638/1351610490069057638 We are using a monorepo as well from the same repository. Hit the limit of 10 pages projects deployed from the repository. We have customers waiting, and I can't find the "limit increase" form... so I thought I would reach out here. Account ID is: 804f65dff7cae7a9f4fee96ca2f65958...

How to use wasm NPM package (pdfium)

I'm trying to use pdfium, but run into errors: 1. import { PDFiumLibrary } from "@hyzyla/pdfium/browser/base64"; Gets me built and deployed, but runtime error of (error) failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder b/c Cloudflare disallows runtime fetching of wasm (even though the base64 is in my code itself). 2. I tried updating wrangler.jsonc, but this property is not supported in wrangler:...

CNAME conflicts with TXT record name

My CNAME conflicts with an existing TXT name, but I think I need both. I'm using Cloudflare Pages and I have a custom domain. I thought I could use a CNAME record to redirect my root to my Cloudflare pages.dev address. But I have a TXT record with spv=1 information that also need to use the root name. Can't have both, but I need the TXT record information so I can send mail from another server. I'm trying to write a redirect rule to point to my pages.dev address, but it's not working so far. Am I heading down the wrong road?...

Astro Starlight Search Feature broken on custom domain but not on pages.dev URL.

- Domain: https://boxersteavee.dev, or https://website-blx.pages.dev - Deployment ID: (where do I find this?) - Account ID: 1dd090371320bab7d015b03071c2435a - No error, but when on https://boxersteavee.dev, the search functionality doesn't work. I just get an empty box. On https://website-blx.pages.dev, it works. These are both the same deployment, and I have tried other devices (including mobile) and other browsers, but it is the same....

Hey everyone, I need some help with Cloudflare Pages.

I've deployed my app on Cloudflare Pages, and I'm trying to implement a multi-tenant feature where each user gets a custom subdomain like user.myapp.com or user2.myapp.com. The problem is that Cloudflare Pages doesn’t support wildcard custom domains out of the box. I tried setting up bulk redirects to handle this, but I’m still getting a 522 error when accessing any of the custom subdomains. Has anyone managed to get something like this working on Pages?...

The entry-point file at ".open-next/worker.js" was not found

I am trying to deploy a Next.js project using the new OpenNext adapter. I've followed all the steps in the guide aside from caching which I understand is optional https://opennext.js.org/cloudflare/get-started ...

No matching export but builds and runs fine locally

``` 00:22:04.996 ✘ [ERROR] Build failed with 1 error: 00:22:04.996
00:22:04.997 ✘ [ERROR] No matching export in "../../node_modules/.pnpm/[email protected]/node_modules/marked/lib/marked.esm.js" for import "Slugger" 00:22:04.997 ...

Unable to deploy in Pages despite `nodejs_compat` being set (SvelteKit and `pg`)

Hi, I have the following dependencies: ``` 23:56:16.139 dependencies: 23:56:16.139 + @sveltejs/adapter-cloudflare 6.0.1 23:56:16.140 + @sveltejs/adapter-static 3.0.8...

what value is CF_PAGES_BRANCH on main

what is the value if the github branch is "main" and it's in production mode? I thought it was main but this code doesn't work when the actual branch is main: const isPreview = import.meta.env.PROD && import.meta.env.CF_PAGES_BRANCH !== "main";

_headers with SvelteKit not applied?

heya, on my SvelteKit site using the cloudflare-pages adapter, I have a _headers file with this content and these show in the Headers tab of my CF deployment but the headers don't show in my network tab requests, any idea why? šŸ¤” ``` /* X-Content-Type-Options: nosniff...

nuxt / drizzle / cloudflare

Hi, When I deploy my app to cloudflare, 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:...

Worker + Assets vs Pages + Worker?

I managed to deploy a full stack app with a D1 database on Workers with static assets but also on Pages with workers. It’s basically the same thing but not really. I’m not sure which option is best. I like that Pages have multiple environments which doesn’t seem to be the case with Workers. Am I missing anything from Workers if I deploy a pages app with workers?...

How do you properly deploy a Next.js app with dynamic routes to Cloudflare Pages?

I’m using Next.js 15 with the new app/directory and trying to deploy my project to Cloudflare Pages using @/cloudflare/next-on-pages. It's a pretty simple project not much going on (repo link below). I've got cloudflare pages connected to the repo an I selected the basic Next.js Framework preset for the build configuration. The build command is: npx @/cloudflare/next-on-pages@1...

Running SvelteKit in Cloudflare

I am moving my SvelteKit from Vercel Edge, which from my understanding is Cloudflare, to Cloudflare directly. However, I get this message when I run a form action: ``bash Error: Can only read the current request event inside functions invoked during handle, such as server load functions, actions, endpoints, and other server hooks. In environments without AsyncLocalStorage, the event must be read synchronously, not after an await`."...
No description

cors setting for cf pages to allow al

"I have a Cloudflare domain with a CF Pages frontend that connects to my backend via a Cloudflare tunnel. However, my CORS is reject all by one origin which is a subdomain I've tried the following without success: - No Pages rules or transform rules are active - Purged cache completely...

Site deployed on Cloudflare is slower and sends more resources than the same site deployed on Vercel

I have deployed my personal website built using Astro on Cloudflare Pages as well as on Vercel. It is a static website. Pages: https://flashblaze-astro.pages.dev/ Vercel: https://flashblaze.xyz/ ...

How do I get cloudflare pages to not install python?

I'm running pages on a subdirectory of a python+bun repo. The page being built doesn't need python. Unfortunately, every build seems to begin with the long process of installing python, probably because there's a .python-version file at the repo root. I'd like to skip this step. I have SKIP_DEPENDENCY_INSTALL=1 but this doesn't seem to help. Somebody online suggested setting PYTHON_VERSION to be whatever's default in the build image, but this doesn't seem like a good solution (it would break if...

does cloudflare automatically updates the submodule in the repository?

I have a folder which is a submodule, does cloudflare automatically pulls it?
Next