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

Wrongfull Phishing Report

I just received the following message: ``` Hello, ...

How to Debug 500 Error After Deploying Astro

Hey guys, wondering how I can look at finding the logs for my pages app (free tier) using astro. It builds and deploys find, but when I visit the pages URL a 500 is returned immediately. When I run locally with Wrangler everything runs fine.
So, my question is - where can I find the logs (looks like they don't come w/ the free tier in CF) ? Otherwise I have no clue what is happening and no way to debug and solve the 500....

[ERROR] A request to the Cloudflare API failed.

I get an error message and can't deploy.

"Failed to publish your Function. Got error: Unknown internal error occurred." on NextJS 14.2.15

I've been trying to deploy an application to cloudflare workers that was built with NextJS 14.2.15 using @cloudflare/next-on-pages 1.13.5. Unfortunately I keep getting the error Error: Failed to publish your Function. Got error: Unknown internal error occurred. I have tried both deploying by having the cloud build the project and deploy built assets from my machine to the cloud. Next-on-pages and wrangler work flawlessly on my side (with the exception of one strange error message which I've been able to avoid by cleaning the build directory each time I want to run). My account ID is: efac12d49017929d19bc2da47c87fd4d The deployment ID is: dfff50f3-cd1e-4748-b499-6657072bc639 I'd provide my pages.dev ID but I'd prefer for the project name not be publicly available for privacy....

Could not route to /client/v4/accounts/***/pages/projects, perhaps your object identifier is invalid

I tried to deploy react app in cloudflare pages in github action but I got this error Could not route to /client/v4/accounts/***/pages/projects, perhaps your object identifier is invalid? . This is my github action workflow ``` - name: Publish Static Files uses: cloudflare/wrangler-action@2.0.0 with: apiToken: ${{ secrets.CF_API_TOKEN }} accountId: ${{ secrets.CF_ACCOUNT_ID }}...

How to add subdomain?

How to add subdomain in cloudflare page like www.subdomain.hostname.pages.dev like that.

customize npm install command on cloudflare pages

I have a monorepo and would like to avoid installing every package on every build (even packages related to applications that are not being deployed). is there a way I can customize the npm install command to add a filter so it doesn't install unnneeded packages?...

MP4 files on Cloudflare Pages - Question

Hello, does anyone know if it's allowed to host .mp4 files using Cloudflare Pages?

Force buildsystem v2 to use --legacy-peer-deps

I set my build command to npm install --legacy-peer-deps, but it is still installing with clean-install Tried setting this to true, but no luck https://discord.com/channels/595317990191398933/1020053805263507577/1104506977788366908 I cannot find any documentation on how to fix this, and if you search this discord there are hundreds of people running into the same issue / asking the same question....

Worker Secret missing after deploying Worker

Hi, I have a Cloudflare Worker that I have connected to my Github Actions pipeline to automate deployments after pushing to a specific branch. I created a secret for the worker in the dashboard and it seems when I push my code, the secret is removed/deleted, which obviously breaks the worker script. Am I potentially doing something incorrectly?

How do you set the "copyright year" dynamically in Pages?

Hello everyone, I am deploying a static website on Cloudflage Pages and want to dynamically set the copyright year so I don't have to update every year (2024, 2025 etc). When I deploy it shows year 1970. Locally it works fine as it's picking up the year on my machine which is correct.

Preflight requests to static Pages are returning 405

I am trying to use cloudflare pages as static html content fetched by a SPA with a separate FE domain. Since the domains are different, browsers send an OPTIONS pre-flight request for each resource. CF Pages currently returns a 405 status code to any OPTIONS request. Is there a way to handle these pre-flight requests without a worker or CF function since that would get very expensive quickly. I've also tried to bypass these preflight requests to a separate domain with a rewrite rule, but tha...

Creating Cloudflare pages for React

I normally create Cloudflare pages for vanilla html & css. But, we are launching a new website with React. I'm a React newbie and I'm a stuck on creating the pages to to work with React. I've read the Cloudflare documentation, but I'm not sure where I put the commands listed on this page https://developers.cloudflare.com/pages/framework-guides/deploy-a-react-site/ Any help appreciated. #react #pages-help #pages-discussions...

Need Help with Astro + Cloudflare + Turso DB Setup

Hey everyone, I’m running into an issue with my Astro app. Locally, everything works fine, but in production on Cloudflare, I’m getting a 401 Unauthorized error when trying to insert data into the database (db.insert(Waitlist_signups)). I’m using Turso for the database as per the documentation and have added the necessary environment variables (both the DB token and URL) in Cloudflare, but still facing this issue. Has anyone encountered something similar or know what could be causing the 401 error? Thanks in advance for any help!...

Cloudflare Cache Is Stuck

Hi - our Cloudflare Cache seems to be stuck for our page https://www.remnote.com/pricing. This URL is from a cloudflare pages deployment. Whenever we load it, we're seeing an old age of 90890 seconds (25 hours). We've tried: 1. Purging our full Cloudflare cache 2. Purging cache for that specific URL...

Accidentally turned on access policy; can't turn off without a credit card?

I accidentally turned on the Access Policy in my cloudflare page settings. When I try to turn it back off, it redirects me to the Cloudflare Zero Trust page, & to pick a plan I have to provide a credit card. Now my preview sites are also behind the access lock, which I can't remove. Example: https://65158e2c.ttc-bus-eta.pages.dev/ I don't have a credit card, I just want to turn it back off. Is there a way to do it?...

How to set up auth for static files

I am using SolidStart which uses Nitro I have been going down a rabbit hole of trying to figure out how I can set up an admin app or portion of the main app and have its static assets protected by JWT auth or something similar I heard of a functions/_middleware.js approach, but this was never deployed/built/recognized by wrangler or the framework Found out it is probably due to the presence of a _worker.js, which is not even a file, its a directory, which I have hardly seen any information about it being a directory I am not sure the best way to go about it. Do I somehow inject code somewhere in the _worker.js directory?...

Issue with Remix App Deployment on Cloudflare Pages - 404 Error After Successful Deploy

I’m having trouble deploying a simple Remix app. I created the app by running npm run remix@latest, pushed the local repo to GitHub, and connected it to Cloudflare Pages. I set up the deployment and picked the correct repo. The deployment is successful, but when I click the link, I’m getting a 404 error instead of the page being rendered. I followed the Pages documentation and pointed to the correct build/client folder. Any ideas on what could be wrong?

What is Cloudflare using to do SSR? Bun? npm?

Like, after building my website, I use npm run start to test it locally, So, what does cloudflare use on the web? bun, npm? I am not asking about what is being used for building, what is being used to run it in production?

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.