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

Where to put database_id for a D1 database?

I am trying to figure out where to put the database_id for a D1 database. I know you can put it in the [[d1_databases]] section of wrangler.toml, but this is a security risk because wrangler.toml is checked into git. So maybe it should go in .dev.vars? But then how do I reference it in wrangler.toml, or is that not necessary? If I put it in .dev.vars, how would wrangler know that it is for a D1 database? And then should it go into wrangler secrets for deployment? Thanks in advance.

Nuxt.js deployment missing CF Functions.

Hi, i just updated one of our Nuxt.js Projects to the latest release version. For whatever reason Pages no longer recognizes the functions folder. Previous Deployments with old Nuxt version didnt have this problem. The functions folder is still present in the repository and is not on the gitignore file...

How can I get a A-Record for my Wordpress Website?

I created a wordpress website on Strato. I chanced the nameserver to the cloudflare nameserver and after 14 hours. my website and Domain ist registered by Cloudflare, but here is the Problem. Now that the domain and website are running via Cloudflare, I can no longer access my Wordpress website and there are no DNS settings. Starto support told me not to change the name servers, but only the A-record at Strato so that the website runs via Cloudflare. ...

How to use npm run dev?

Hello everyone. I'm currently using cloudflare to develop backend. But I can't run num run dev, So I have no choice but to deploy with the num run depoly command. If anyone knows how to run the npm run dev command, please let me know....

Ignore build step

Hi All 👋 I have a two cloudflare pages project setup on the same github repository to seperate environments with automated deployments. - acme-production (branch main) - acme-staging (branch develop)...

How can i use modules in Pages functions

How can i use modules i already installed on Pages on the /functions dir, i'm lost help, i understant it works like Workers no?

Array.prototype.toReversed() works at runtime but not build

I have an Astro project that uses toReversed() on a json import, this works fine on SSR pages but fails saying that the function is not defined during build on an SSG page.

Build Stuck

I am using Bun as my pm, and have a command called build I use to create a bundle.js file. The build command runs perfectly, but my project remians with a Building... status. How could I configure the build settings to fix this?

Do single redirect rules work on Pages Custom domains, seems they dont.

Been trying to create a redirect rule with pages custom doamins, but seems it they only work with the primary domain, i have used trace and they dont pick up the rule on custom domains. i.e. my pages domain is mycompany.com, but custom domains are docs.customerA.com with a cname to my pages domain... hence any rules for the docs.customerA.com do not work -- is this by design.

domain not working even though it says active

I'm trying to connect my domain to my project, things that I have already done: - changed my DNS records in name.com - added DNS record like in the pic - custom domain says it's active my .pages.dev works fine but the actual website doesn't...

Alternatives to DOMPurify?

Both DOMPurify and isometric-dompurify don't work and show a "ReferenceError: window is not defined" error. What alternatives can I use that work with Pages?

Build pipeline times out since using sass-embedded

We need to add sass-embedded in our vue project. Since then, our Cloudflare pipeline won't build anymore because it times out after successfully generating content, as it seems. - Acc 28f9ea6fa36ba010df69e764aa3c0ca2 - deployment id fbe8b425-9d7a-4794-a0e2-5fcb45123ddc ...

How to deploy pages from command line?

My project contains a frontend directory (with src/ and build/ inside it) and a functions directory (containing cloudflare functions). I usually deploy my cloudflare pages by just making a commit and pushing an update to the branch. But I wanted to deploy without pushing and used this: wrangler pages deploy frontend --project-name project But now my deployed site is broken and blank. Maybe cause I only passed the frontend directory to the pages deploy command and it missed the funcions/ directory? How do I do this properly?...

Does page function support DO webscokets

title, i asked this question in diff channel but no one seems to have a clue 😦 i thought it is an easy question, im not able to make it work ... WebSocket stuck at connecting. Any help

Error with pnpm run build and Issues Modifying 'node_modules' File"

Guys, can someone please help me solve this? Every time I try to run pnpm run build, I get this error, but the file causing the error is part of the 'node_modules' folder. I've already tried several ways to fix it, but I haven't been able to find a solution.

Long build times

``` 20:04:30.977 Installing ruby 3.3.4 20:04:31.363 ==> Downloading ruby-3.3.4.tar.gz... 20:04:31.369 -> curl -q -fL -o ruby-3.3.4.tar.gz https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.4.tar.gz 20:04:31.382 % Total % Received % Xferd Average Speed Time Time Time Current...

website doesnt work (im a newbie)

Hi, i tested my folder, site runs fine on localhost. I set everything up within cloudflare, imported my github repo etc. Created a Cname dns everything. I dont know what im doing wrong

tunnel created but not working

Hello, I created a tunnel with cloudflared to allow me to access a server where I can save and render images for my page, but for some reason I get this message. Does anyone know what's happening? I haven't known what to do for weeks

Setting cookie on custom domain

From a function I am trying to set a cookie on create.discordforms.app, this is not working but it does work on the non-custom domain forms-builder.pages.dev. Header: ``js 'Set-Cookie': session=${sessionID}; Secure; Path=/; Max-Age=${expires_in}; SameSite=Lax`,...

_redirect file or redirect rule? - Redirect a saas custom domain to apex domain

Posted this pages discussions;got no help, sorry for retrying here:/ Using a _redirect file or a redirect rule, are they the same thing essentially?, one is a GUI and another is a text file? Ideally i want all cname that do not have a path of /dash to redirect to my apex domain....