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

How do I setup a github action to deploy to production and not preview?

Below is my current github action which does work for preview deployments. I'd like to be able to deploy from production for it. ```yaml name: Deploy on:...

How to use MDX on CF Pages?

I am trying to use CF Pages for my Next.js blog. I use MDX for that. I followed the instructions from Vercel (https://nextjs.org/docs/app/building-your-application/configuring/mdx) and this is my next.config.mjs: ```ts...

Error publishing hugo site

Deployment ID: f7839d1b-daef-4cef-9496-b694de6abd79 I can build my hugo site locally but when building the same github repo in pages I get the following error message: FatalError: Failed to upload files. Please try again. Error: {"text":"Received a malformed response from the API","notes":[{"text":"<!DOCTYPE html>\n<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->\n<!--[if I... (length = 7174)"},{"text":"POST /pages/assets/upload -> 524 "}],"kind":"error","name":"APIError"})...
No description

Are environment variables available at build or only runtime?

My SvelteKit builds fail when I use import { SECRET } from '$env/static/private' or the public equivalent ($env/static/public) with an error such as:
RollupError: "SECRET" is not exported by "virtual:$env/static/private"
RollupError: "SECRET" is not exported by "virtual:$env/static/private"
However accessing environment variables via import { env } from '$env/dynamic/private'; works....

Can't figure out how to promote a preview environment to production

I'm in the Cloudflare dashboard and according to the docs there should be a way to either manually promote a preview environment to production or to add a git integration and neither of these options are in the UI. There is supposed to be a "Builds & deployments" section under settings but this does not exist....
No description

522 Timeout After setting DNS server to point to Cloudflare Pages

I have a working Cloudflare Pages website. I wanted to use a custom domain, I have had this domain bought from GoDaddy. Before, this domain was forwarding to a Looker Studio dashboard. I removed the forwarding rule and added Cloudflare’s nameservers. Then I added the custom domain in my Cloudflare page. I keep getting 522 and Cloudflare’s error page, I have no idea what I did wrong. I asked GoDaddy they told me that the issue is either Hosting or Domain DNS. Both are with Cloudflare so it is purely issue with Cloudflare only. Any idea how to fix this so that my custom domain start going to my Cloudflare Page app? I also installed WARP and tried the website after switching it on, but with no luck, still got the same error. ...
No description

Cannot Interact with D1 Locally on Cloudflare Pages

Hi I'm currently facing an issue, i'm getting an error D1_ERROR: no such table: But if I publish the project and access it, it works. I don't know if I'm missing something. ...

Hosting Multiple Projects on a Single Domain

Is possible to host multiple pages projects under a single domain, where each project is accessible through a different path or subdirectory. For example, if your domain is test.com, and i have two separate projects, helloFolder and worldFolder, and i want to access them at test.com/helloFolder and test.com/worldFolder, respectively. i do not want to have one main folder and this two folders inside the main folder

Need help with redirects.

This question is in relation to Cloudflare pages, probably using the Github integration. If I wanted visitors to example.com + www.example.com permanently redirected to a subpath such as example.com/sub what would be the best way to do it? I have found the 2 dev links below but I'm not sure what approach to take....

Do static export from NEXTJS pa ges count towars function usage?

I understand that even static generated sites at build time count towards fuinction usage. :NotLikeThis: Do sites generated using output: export (nextjs´s HTML export) also use functions when being visited by users?...

How to Track Build Count

I'm currently on the free plan so I see that I have 500 builds per month and have a couple different pages running, is there any way to see how many of the 500 monthly builds I have used to see if I'm going to be running out? I'm working through iPad for the rest of the year because were traveling, previewing builds through Jekyll have to be done through a preview deployment on pages instead of locally on my machine (couldn't get Jekyll gem to install on iSH) driving up my build usage....

No details on failed deployment

Hell guys, I was trying to deploy a new version of my application and I noticed several things. 1- the deployment failed but I have no idea why and the CF UI doesn't provide any detail about it. (the console says it was deployed successfuly) 2- the deployment associates a KV namespace which is not longer associated, so I wonder if it's cached or something: ...
No description

env.ASSETS.fetch doesn't return additional headers

I have a Pages project with a worker (advanced config) that attempts to add a cookie via adding headers to the env.ASSETS.fetch call ```ts return await env.ASSETS.fetch(request, { headers: {...

Error: Pages only supports files up to 25 MiB in size - but my bundle is less than 5MB

I'm attaching my next analyzer nodejs.html and cloudflare pages log. Where is the other 40MB coming from? 23:44:49.431 cache/webpack/server-production/0.pack is 45 MiB in size How can I get access to this file to check it?...

what counts as workers/pages function

Hello. So i made a sveltekit web app. hosted on cloudflare. it shows up under 'Workers & Pages' -> 'Overview' section. i can see that there's a limit of 100k dailiy requests, but i don't quite understand what requests these refer to....

How to access a D1 binding from a next.js tsx file (NOT .ts)?

In my next on pages app, I got a db call working on a .ts file but I'm wondering how I access that data within a tsx page? I've read all the documentation but I don't see any next.js examples of calling data within a .tsx server component, only from a .ts file (which I can't import bc of this error in the screenshot). Open to any suggestions :PES_CryHug: ```js...
No description

Production branch deploys are being skipped after retrying a deployment manually

Hey I recently had to retry a deploy manually, since then all pushes to my repo are being skipped by my pages build pipeline. It gives me a warning that I need to change my build settings, but everything looks good there. What do I need to do to re-enable it? Thanks!...

Failed: an internal error occurred. If this continues, contact support

Hello! I'm trying to deploy a next-on-pages app, but am getting this error: * Pages URL: https://highsocietydispo.pages.dev/ * Deployment ID: 4b73ae3b-3570-4b68-8378-1da4c19d54ff * Account ID: 107a3aac2bff45c39e4a11e75d53082f8...

Issue with Next.js (next-on-pages), API route and R2

Hey, any help is appreciated, thanks. I have a route that returns the list of objects in R2, it works the first time, but if you try visit again or refresh too quickly I get an error "The script will never generate a response.". lib/r2.ts...

Advanced Mode and Wrangler file bindings

Hi all! Is there a way to use bindings (specifically Hyperdrive) with Advanced mode? I've tried migrating to use a Wangler file, but I am not seeing the binding after deployment. Thank you!