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

Migrating from Vercel, vercel.json alternative

Hello everyone, I am migrating my projects from Vercel but cant find a way to setup my project like I used to in vercel using a vercel.json that contains: ...

Gitlab pipelines - "created by"

Hi, I have a customer that has some high level attention to details and is complaining about the person assigned to "created by" column in Gitlab pipeline. Is there a way to change that? I have no idea how is this thing selected. The story of our repository and Cloudflare Pages connection is a little convoluted and goes like that: - I created the Cloudflare Pages + Gitlab connection from account A and using repository X - We moved repository X to repository Y (just changed the name basically) - Almost everything work except for deploy hooks which could not find the branches - Client requested that account B should be responsible for Gitlab connection so we removed the whole Pages project and started from scratch and connected it via account B to repository Y...

NextJS is slower on CF than on Vercel

So I'm looking to optimise my NextJS website (just the landing page) to ensure that it has the best ranking opportunities on Google. I ran the lighthouse test on the current website (https://cruncho.app) which is currently on CF and then compared it against (https://cruncho-landing-karthikjn01.vercel.app/) which is running on Vercel. I found the lighthouse score to be quite a bit better on vercel than on CF which is strange cos Vercel (edge) runs on CF right? Cloudflare LH score: (80) Vercel LH score: (94) ...
No description

Having trouble getting custom headers to work

Hi, it seems like I have everything correct, but as you can see, the x-frame-options header is not appearing, for example. https://greatmates.pages.dev/ https://mm.global account id: 7db2928ba7c67dfcf1784ad36892e88d...
No description

Nuxt `npx nuxi generate` sometimes builds to `.output/public` and other times to `.dist`?

I'm using the latest nuxt on cloudflare pages but my builds are failing sometimes because of the differing output dir. I don't really understand what is causing the difference in behavior. I'm following the nuxt docs on deployment so on CF pages I'm running npx nuxi generate and looking for the build dir of .output/public. I've also tried with node 16 and 18 but it doesn't fix the issue. Some branches are building, while others are not on CF. If I clone the branches with failed builds and run npx nuxi generate locally it builds to the correct .output/public dir. ...

help me with this please

14:17:55.530 Finished 14:17:55.531 Note: No functions dir at /functions found. Skipping. 14:17:55.531 Validating asset output directory 14:17:56.304 Deploying your site to Cloudflare's global network... 14:17:58.924 ...

Uploading HTML Based Project dynamically

python, httpx, build dir is ./build/html/

How to know when deployment was successful and is reachable?

Is there a way to check/know after a wrangler pages deploy that the page and its functions are successfully deployed and reachable? I am already waiting for 5s after deploy before I check, but often that still leads to a HTML page instead of the Json that I expect from my function/worker....

Build error with simple ReactJS app on CF Pages

Hello. I'm new to Cloudflare Pages. I am attempting to deploy my react app onto it and have successfully connected. However, on deployment, I am getting the following error: ``` ... 19:20:20.496 Success: Finished cloning repository files 19:20:21.268 Detected the following tools from environment: [email protected], [email protected]...
No description

NextJS dynamic page with catch all route overrides all API routes

I've run into some trouble when using a catch all page routes on the top level (e.g. /pages/[...slug].tsx ). When trying to call any API route, it seems to route incorrectly to the catch all page instead of hitting the API endpoint. I've tried doing local dev/builds and deployed to Vercel with the same codebase but haven't been able to reproduce it in all other circumstances, so it looks like it only affects @cloudflare/next-on-pages builds. Has anyone encountered this problem before?...

Slow Cloudflare Pages

We've deployed multiple Cloudflare pages for ss.dev, and samespace.com domains. The pages for ss.dev are taking a lot of time to open. For instance, avenue.ss.dev takes a lot longer to open than avenue.samespace.com. We used mtr to check for any issue in routing and found out that avenue.ss.dev is being routed from France/Europe, and there is also significant packet loss (20-30%) in some of the hops. We operate mainly in India btw. Could anyone please help with the issue? I've attached the mtr results as well. Thanks....
No description

Page not displaying?

I uploaded a simple html and css. But when I click the deployment, it shows default demo page?
No description

CloudFlare Pages Pointing to Domain from Different Account

if I am hosting Nextjs App in my CloudFlare Account, then can I able to point to the Domain which is registered with another account or different Domain Registrar?

Firebase for NextJS: "invalid key" when deploying on pages

When using pages to deploy my next.js project, it says that the firebase keys are invalid. I have made it log them when building (for debug ofc), and they are correct. They are stored in process.env, and the domain has been added to firebase's allowed domains. Can anyone help? Account: c2cde2a643941234effc212d3922009f...

Error: Failed to publish assets.

Hi, I'm trying to evaluate Workers&Pages to move my Astro app. The build succeeds, but I get errors like this one:
Error: Failed to publish assets. For support, join our Discord (https://discord.gg/cloudflaredev) or create a ticket and reference the deployment ID: 17e127e9-3242-4017-bf03-2d9923221c19
Error: Failed to publish assets. For support, join our Discord (https://discord.gg/cloudflaredev) or create a ticket and reference the deployment ID: 17e127e9-3242-4017-bf03-2d9923221c19
...

Trouble uploading React app to cloudflare

Howdy yall, I recently finished making a website using react.js, and I was uploading it with cloudflare, but when I try to build and deploy it I keep getting errors, and I'm not sure what to do to fix it. I followed the doc https://developers.cloudflare.com/pages/framework-guides/deploy-a-react-site/ and I'm on the last step, deploying it from my dashboard. here's the log any help would be appreciated as I am very new to all this :) https://qc-data.pages.dev/...

Experiencing extremely slow load times

I'm hosting a clients website on cloudflare pages (astro SSR), and up until tonight it has been loading extremely fast. Tonight I've checked on it at random and a sometimes it will pop up in a few milliseconds and sometimes it will take 10 - 20 seconds. Has anyone else experienced this, or is there a service issue?

Internal error occurred when deploying

Hi, I’m deploying an astro build website from github. It builds correctly and fails at deploying. This started happening a couple of days ago. There are no useful logs that I can find: ```...

Exporting multiple functions in middleware plugins

I am looking into using cloudflare plugins to apply middleware. We have multiple functions we would like to chain together. - One option is to create 4 separate repos. One for each plugin, and then chain them together in the application. However this is not a desirable option for us. - the second is to export a single plugin which uses flags to apply the different functions as needed. - We are wondering if we can export multiple functions from a single plugin and import whichever ones are needed, to be chained together in the function. This is the preferred option. Can anybody confirm that this is a viable option, and give advice on how best to do this? Thanks in advance...

Next on Pages with Next 14 suddenly produces huge build package.

Just upgraded to Next14 on a project, and now npx @cloudflare/next-on-pages produces a huge 45MB output and I get the Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size limit (workers.api.error.script_too_large) Is this a known issue when switching to Next14, I'm aware it only came out a little bit ago. Or is this something more to do with my project? Also while debugging and building using npx @Not Cloudflare :)/next-on-pages I keep getting asked to log into vercel, but that only happened after a few tries, what's up with that?...