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

Turnstile protected form on an Astro website hosted on Pages, TS backend on Functions

Hello, I'm building an Astro test site and I would like to have everything "running" on Cloudflare. One of the things I want to demo is a simple form protected by Turnstile. I have no issue with the front-end code which is working fine. When I click on "submit" I'm calling xxx/api/submit, on my project I have a TS script in root/functions/api/submit.ts. I have no error when I'm comitting my code, the functions folder is detected by Pages, but while I'm doing my test and clicking on "submit" on my form I always have a 405 error. I noticed in pages/functions real-time log that I have a double '/' in the path ... that could explain the 405, but on the browser side I don't have the double '/' (see screenshot attached) ...

SvelteKit private environment variables not exported.

Hello! During when my project is being built, I get errors like this:
src/lib/file.ts (1:9): "PRIVATE_ENVIRONMEN_VARIABLE" is not exported by "virtual:$env/static/private", imported by "src/lib/file.ts"
src/lib/file.ts (1:9): "PRIVATE_ENVIRONMEN_VARIABLE" is not exported by "virtual:$env/static/private", imported by "src/lib/file.ts"
My sveltekit project builds fine locally, maybe because I actually have a .env file. On CF Pages, I set the environment variables in the settings to the same as my local, but it looks like it's not able to find them during the build. I've looked around I saw that people have put the environment variables file into their github repo, but I wanted to ask here if there was another solution. I'm currently don't have an .env in my repo....

Page can't be found

So I've uploaded my files and depolyed it, but when looking at ghaztliousmothsart.pages.dev, Edge keeps telling me that the page can't be found. I don't know if I missed something.

How do you read & write files?

I've tried importing fs, requiring fs but this is the message ---> I cannot find any other way to read & write files, I'm trying to make a simple folder called Users, with files for each user id....

11ty v3.0.0 build time jumped from 1min 20 to 7min+ (460%)

Something happened to my CF Pages environment between 12:33AM December 19, 2024 and 12:19PM December 19, 2024 (UK time) as my build time increased from 1 minute 30 seconds to 7 minutes 22 seconds. I have GitHub rebuild my website every 12 hours and during this time I made no code changes, but something in the Cloudflare Pages environment must have changed as the build time jumped up 460%. No error messaged are seen in the logs, so I’m a little stumped as to what I can do toy fix it! Any help would be much appreciated! I have posted on the community forum here, but so far have had no feedback to help solve the issue: https://community.cloudflare.com/t/11ty-v3-0-0-build-time-jumped-from-1min-20-to-7-minutes/750917 ...

Sorry, you have been blockedYou are unable to access yeniwatch.net

Hello, I live in Germany and although the site was open yesterday, the site appears to be blocked today, please help.

CSS broken in pages deployment that did not exist in previous deployments. No code changes

Hi, I have a site that uses seafowl to display data in a react-data-grid. It's an old project, and the css seems to now be broken after deploying. There have been no code changes to the actual site, so it's quite weird. Any ideas? Latest, broken site: https://bostadsbussen.se/sold/query...

gRPC

Hi dear community, I would like to know if CF supports gRPC and what the scope of the support and possible integration is. Is there anyone here who works with this protocol and CF and has any recommendations or insights?...

Functions prod vs dev

So i was following thie pages-functions guide: https://developers.cloudflare.com/pages/functions/get-started/ seems easy.. put in /functions folder and you good to go. so for the sake of checking its working copied the function from the guide....

Automatic Cache Purge

Is there a way of making a rule that when a update deployment is made on Cloudflare Pages that the Cache is automatically purge

Help needed

So I have 2 people who have a Minecraft server one has port 25565 but another 1063 but the default MC port is 25565 how do I fix this because it has been added to Cloudflare in the DNS records only pterodatyl is stubborn and doesn't want to make a new allocation because it has to be glacial.epicnode.nl:25565

Remix SSR build on Github Actions

I moved my builds to github actions for caching. The project is a monorepo with multiple remix packages, two are in SPA mode, and deploy fine, since there is no build/server. One of the packages is in SSR mode, and returns a 404 since the functions directory is not built into a worker by the remix vite:build command, understandably....

New builds result in NextJS crash

Recently I updated a JSON file on my website's static assets folder, and today I noticed my site is showing a "Internal Server Error" screen Considering it is a minimal screen and not the cloudflare one, and cloudflare not showing any error rates on the metrics screen I imagine it is NextJS, I tried rebuilding on top of the latest commit and an old one that was working and both resulted on the same error, for now I have rolled back I am using an old successful build I have not changed any setting or option in the page since the successful deployment...

Cache Errors rendering site unavailable

Occasionally, with no intervention - our apps will cache incorrectly causing the app to be unavailable on Pages. We mostly see this as pages that should be returning javascript return the homepage instead. To get around it, we usually run a "Retry deployment" which to my understanding invalidates the existing cache on the affected pages. I am certain this is not a oneoff, this has happened twice to the primary subject of this report but also my personal website which does not use Next.js. We are playlessgames.pages.dev...

Global 404 not working on pages.

My understanding of 404's on cloudflare pages is that you set up your 404.shtml/html in the root of your project, and cloudflare designates that as a global route on the backend with no other work needed to serve 404's. So say I only have an index.html on example.com, and I go to example.com/fart, it will give me a 404 just fine. I have noticed an issue with multiple projects now, where the 404 at the root will not apply to directories on my pages projects, so if I go to example.com/fart/index.html (which doesnt exist) ill get a broken 404 that doesnt fully load with the assets/etc ive defined in the 404 at the root. Ive tried clearing cache, ive manually set up the 404 in that directory and it starts working after purging the cache, so is that the way I have to do things? I have to have a 404 set up per web page directory??...

Creating Pages projects based on GitLab failing with generic error message

This is my account id: 847e34e5bfebe477b140713ecad9fe01 and I'm trying to create a pages project by connecting it to a GitLab hosted project but I'm getting following message on the UI: An unknown error occurred. Please try again later. and by investigating the call, the reply contains this body: `{...

Can I use pages.dev for BlueSky?

I see some people on Bluesky use github.io domain on their username handles. Is it possible to use pages.dev domain for username handle in Bluesky?

"Error: [unenv] crypto.createCipheriv is not implemented yet" when using Auth.js

Using GitHub OAuth with Auth.js and SvelteKit, I get this error when an user clicks "Sign in on GitHub":
[auth][error] Error: [unenv] crypto.createCipheriv is not implemented yet!
[auth][error] Error: [unenv] crypto.createCipheriv is not implemented yet!
Is there any way around this? (except moving to another platform :/)...

Increasing limits on pages for static site generation

Hello! We are building and deploying websites using Cloudflare Pages. The sites are built with Astro (https://astro.build/) and leverage static site generation to create HTML files for the site. Our goal is to generate most or all of the pages of the site, and only dynamically generate select pages with more dynamic components. This site is just a blog, and the page content is generally only housed in our CMS, so if we have to dynamically generate the pages, we could. However, we're looking to migrate an additional ~30 websites into this setup, and many of them have 2 or 3 different systems we will be pulling content from in order to generate the page, so it will be important for us to be able to build static HTML so we don't have multiple backend dependencies to serve a page response. We are running into the limit on files of 20,000 listed here: https://developers.cloudflare.com/pages/platform/limits/. We initially submitted the form to request an increase a couple weeks ago and still haven't heard back. Before we commit to this tech stack for our website hosting, I want to make sure we're not going to hit this limitation on our other websites as well. ...

Support bun new text-based lockfile

Since bun version 1.1.39, it supports new text-based lock file inplace of old binary lockfile. - https://bun.sh/blog/bun-v1.1.39#bun-lock-is-bun-s-new-text-based-lockfile - https://bun.sh/blog/bun-lock-text-lockfile In my repo, I replaced bun.lockb file with bun.lock...