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

n00b Q: next-on-pages + D1 binding

i have seen some conversations and examples on discord, but still running into some mistakes, 1. if i try to access a d1 binding using the suggested dev approach (watch build + wrangler pages dev), i am able to access the d1 instance (the instance is not undefined and the dev command shows a binding to the d1 db created from the gui), but not view the table (e.g., wrangler crashes saying table does not exist, but i can confirm it exists by using the CLI), i think i am misunderstanding how wrangler pages links to the d1 db, i.e., does the dev command create a local one or is there a flag to pass? 2. when using the npm run dev + cf-proxy workflow, i am able to access kv, but not d1, e.g., it returns undefined when wrapping it: binding(process.env.db), ...

How to set domain for preview branch?

I can't find the options to set preview domain to preview.<myapp>.pages.dev

Pages application deployed, can access it via pages.dev but custom domain 404's

I have a remix site deployed to twitchroulette2.pages.dev and have https://twitchroulette.net/ pointing to it via the custom domain flow. The domain is 404ing and I'm unsure how to debug. Any help would be appreciated.

Pages+custom domain+access: public on main, private on preview

It's a basic use case that I am surprised Cloudflare hasn't thought about. * I use Cloudflare Pages. * The pages system builds a production build (available at example.pages.dev), and a preview build (available at two urls: git-branch-name.example.pages.dev and git-commit-hash.example.pages.dev) * I add a custom domain, example.com....

Cybersecurity tips

Hello! I am wondering if the $20 Cloudflare plan provides adequate web cybersecurity for a static website hosted on pages. Are there any additional measures I should consider in the source code? Note that my site does not have any login or user-only areas.

Linux warp in debian parrot repository 'https://pkg.cloudflareclient.com ara Release' no release fil

E: The repository 'https://pkg.cloudflareclient.com ara Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. I followed this https://pkg.cloudflareclient.com/ for installation...

SvelteKit D1 example works in local but not after deployed to Cloudflare pages

I can get data from D1 in local:
npx wrangler pages dev .svelte-kit/cloudflare
npx wrangler pages dev .svelte-kit/cloudflare
but when I deploy to Cloudflare Pages via Gitlab CI, I just got an empty exception without error....
No description

Not deploying

Pushed my changes to git, it has all the proper permissions and would deploy automatically previously. Haven't changed anything, but it isn't deploying. Any ideas?

D1 migrations apply in Pages deployment?

Hi, I'm currently testing the possibilities of running a Remix project on CF Pages, using drizzle ORM for D1. Got it running fine, except I can't figure out how to excute the wrangler d1 migrations apply on deployment (either production or preview). - Attempt to do it in the build script result in failed deployment (even with a CLOUDFLARE_API_TOKEN env var) - Migration works fine when ran from local terminal (local or remote D1), but I think DB migrations should be handled in the CI ...

await fetch() in Remix loader function has suddenly started malfunctioning on CF Pages

On a site on Cloudflare Pages that has been live for many months, the fetch() call to a graphql persisted query endpoint (a plain GET to return JSON) now MOSTLY seems to error, but sometimes returns the correct data.
fetch always works running locally no code changes to the Remix app for months CF Pages app uses Unbound functions...

Use Service Bindings in local development

Is there a way to use a service binding... Pages Function to another Worker locally? The docs mention that is works but I can't find how to make it work. There is nothing further in the docs....

Bugs in Pages Functions?

I successfully deployed an Astro site to my Cloudflare Pages account. I'm not using SSR on this site. However, for my functions folder I'm getting two very strange behaviors. One of which I found a GitHub issue on . Sorry I don't have the link at the moment. 1. Wrangler CLI is complaining that the request is being cloned when it's not. ...

Pages _headers file allow access JSON file

Hi everyone, I have a React app on the Cloudflare page and there is a JSON file I want to access through the URL. In my build, I tried to include a _headers file like in this documentation: https://developers.cloudflare.com/pages/platform/headers/#attach-a-header. The file is like below:...

High functions metrics figures

I have a website hosted on Cloudflare - https://tmdb.athena-designs.com According to the web analytics it has had 11 visits and 19 pageviews over the last 24 hours. ...

TCP connection possible in NextJS?

Since cloudflare supports tcp connections on workers is it somehow possible to use tcp connections in NextJS

a cloudflare tunnel to connect to a local website

I try to create a cloudflare tunnel to connect to a flutter website running (using "flutter run" command) on my local MAC. I have done this successfully for connecting to a web service running locally. But the tunnel for the flutter website does not work. https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/ says "Cloudflare Tunnel can connect HTTP web servers, SSH servers, remote desktops, and other protocols safely to Cloudflare.". Does it mean tunnel does not work fo...

Build unable to access node.js

Looks like Pages building isn't able to pull the node.js version required, gets a 500. I'm able to access the attempted download URL manually, but that doesn't really help. This Pages site last deployed to production 7 days ago, and a preview 6 days ago. ...

Shallow Git Repository Clone

I am using cloudfare to host my website although while cloning the git repo it does a shallow clone but I want it to do a "full" clone as the repo history has some information my code uses. Is there an option to change / enable this on the free plan?

change page extension

How can you change the extension that reflects pages.dev
No description