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

running code on preview destruction?

We need to add our preview urls to our auth system dynamically, and want to remove them after they’re merged or closed. Is there any way to run a job or hook when a preview is torn down?

Caching to save on request quota

Hi, We are developing an API powered by Pages and Functions. We get many requests with the same parameter which get the same response every time (but they can't be served statically). Is it possible to cache the response based on the url and params to save on requests quota?...

How can I use web crypto in pages with Sveltekit?

I had deployed an app to cloudflare pages but web crypto is not available.

308 error on missing chunk

Hi there! Why would we get 308 http status code for a JS chunk that exists (and is confirmed to be uploaded) in a pages deployment? We use cloudflare pages to serve our frontends. The build is slightly complex so we use the wrangler direct upload method and it generally has worked....

domain link setup help

So I bought my own domain and Im trying to make that if you search that domain it will link you to another website (though Cloudflare) Problem is that im trying to set it up on the cloudflare DNS record page and I just cant to that any help? thanks...

Help with 1 MiB size limit.

Hi, im trying to deoploy nextjs, next-auth with prisma (with edge runtime configs and prisma accelerate) and i have this isues when deploy on cloudflare pages. "Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size limit (workers.api.error.script_too_large)"...

Need help building application with SSR.

It seems the build guide is outdated. I've gone ahead and added the compatability flag, but do other things need to be set? What is my next.config.json supposed to look like?

Why wasn't build/deploy not triggered for Pages, after pushing to the preview branch?

Hi, We're using GitLab. staging branch is configured as preview branch for Pages. A developer has merged and pushed the code into the staging branch, however the Pages build has not been triggered. Before that, the builds were working as expected. This is the first time another developer has pushed into this branch....

Deploy Streamlit App to Cloudflare Pages

Is it possible to deploy a streamlit app to cloudflare pages? Streamlit is basically a python web app framework. Read more here: https://streamlit.io/ I've tried deploying it to cloudflare pages and it manages to build but hangs at this step and doesnt get to the deploying step. It hangs right after it says its ready to view in the browser and has a URL available....

PNPM Monorepo on cloudflare pages

hello, i have a pnpm monorepo using lerna, i would like to deploy one of the apps to cloudflare pages from my monorepo heres my build configuration ``` Build command: pnpm install --force && cd apps/cdn && npx @cloudflare/next-on-pages@1...

How to deploy functions with Pages?

I am working on my 1st CF website and everything works fine on static files, except the /functions directory is not deployed for some reason. When I check the deployment logs on cloudflare dashboard, connected with Github. It says the /functions directory found but no routes found. ```...
No description

Is mTLS supported in front of Cloudflare Pages?

(I made a post on this a couple weeks ago on cloudflare community: https://community.cloudflare.com/t/mtls-in-front-of-cloudflare-pages/537002) I want to secure a pages deployment with mTLS. (So when a user goes to the pages site, their browser prompts them to choose an mtls certificate). I have mTLS enabled for the hostname which the pages site is hosted on, and I have the certificates set up. However, Cloudflare never prompts me for an mTLS certificate when I try to access the site and I just get blocked by the WAF rule...

PRs from forks should trigger a preview deploy

Hi, Cloudflare automatically deploys when new commits in the repo. When a user forks our repository and opens a PR against our repo, it would be great if I was able to preview the PR....

Integrating a blog to cloudfare single page website

Dear Team, Newbie here, I have a single page html website running in Cloudflare ( account #c4ace3830e978a0d252919a63bb95ba0) code is in git and built via Cloudflare pages and routed to custom domain which is also bought from Cloudflare. No I would like to add a blog section to my single page website, so what is the best option I can use ? There were some suggestions like I have to move to different hosting provider and then install word press etc etc, But before processing I would like to check is there any better option within cloudflare ? Because Currently I like my process, when I push my website changes to github, the pages automatically build and publish my website. So please help....

Can't deploy a TypeScript app: tsc not found

Hello! I have a simple Vite (React + Typescript) app I'm trying to deploy on Cloudflare Pages. I have my git repo hooked up, but when I push, the dependencies all install correctly, it correctly runs npm run build, and I then get sh: 1: tsc: not found.

Page functions on a docusaurus project

I'm working on a docusaurus project in which I want to add page functions to use as proxys. I've tried both leaving my functions folder inside my root, as well as moving it to my static folder following docusaurus docs (https://docusaurus.io/docs/static-assets) None of these solutions worked in my local environment. I tried both with docusaurus start and docusaurus serve....

Cloudflare pages-actions and monorepo nx

Hi guys, what would be the best way to deploy multiple apps with the actions of cloudflare pages? I have a monorepo with nx and I have several apps that are deployed to cloudflare. In the documentation it says the steps to follow for a project. If anyone has an example of a monorepo with this workflow I would appreciate it.

Error 522 on Cloudflare hosted site

Yesterday we began getting errors (522) on our site which is also hosted by CF and as Im a junior I hoped that someone would know but as our lead left a few days ago I find myself in the deepend on this. I have tried clearing the cache on our dashboard. Is there maybe some limit we have hit? I checked the server status and it seems operational. Help pls

Cannot find name 'PagesFunction'

Hello, Im quite new to all of this. I just set up a website on pages, that part works perfectly. I Want to add a contact form with mailchannels and used the code in the docs (https://developers.cloudflare.com/pages/platform/functions/plugins/mailchannels/) as a starting point. However i get the error that PagesFunction cannot be found. Do i need to do additional setup outside of what is mentioned in the docs? I can't seem to find many tutorials explaining this in depth. I started a clean pure html project to test and it has the same error. I ran npm init and installed the the plugin without errors. I then created a file called _middleware.ts in a folder called functions in the root of the project. This is where i pasted the code from the docs, and where the error shows....
No description