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

Can Nuxt.js make api calls during build time on CF Pages

I have an headless CMS an want to build a frontend using Nuxt.js, deployed on CF Pages. My headless CMS will use a web-hook to CF pages when content is updated to rebuild the frontend to static data. My question is: Can Nuxt.js make api calls during the build process to my headless CMS to get the content needed to generate the website and how?...

Sveltekit + Lucia: Error: The script will never generate a response.

A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished.
✘ [ERROR] Uncaught (in response) Error: The script will never generate a response.
A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished.
✘ [ERROR] Uncaught (in response) Error: The script will never generate a response.
...
No description

I am trying to build my website on CloudFlare using React.JS

I am trying to build on my website using the Git repo on Cloudflare, but everytime I build it I run into this error. I have tried deleting the yarn.lock, then yarn cache clean -all, then yarn install. But it always gives me this error. I am kinda new to web development. This is my git repo: https://github.com/BuraiStar/BrianWongPortfolio...

Pages and Strong ETags

Does Pages automatically generate strong ETags that we can configure as an Enterprise customer? We have a ton of ongoing cache issues related to weak ETags and CSP hashing where our app cannot be loaded by some users. We suspect it has to do with weak ETags being used rather than strong ETags. I was reading through https://developers.cloudflare.com/cache/how-to/cache-rules/ which allows for strong ETags, but this implies that Cloudflare cache will respect Strong ETags served from the origin which for us is Cloudflare Pages. Hence the question if Cloudflare Pages will generate Strong ETags. (Note that we are an enterprise customer)...

Page slug are showing 404 page

Am developing a project with Next + sanity after deployment i discovered that the all page slug like post/[slug] and others is showing 404 pages , so i build on CLI and see that the page slug is not build Am also all my images are not showing expect the bg image Please how can i resolve it...

My page is not working with DNS Error.

https://netflix-clone-coding.pages.dev In dashboard, there is no problem tho, when I access my page, it showed only error page with this message. "DNS_PROBE_FINISHED_NXDOMAIN" ...

Why Pages don't have a wrangler.toml?

I think the biggest confusion about using pages right now for me is that there is no real way of configuring a project in the CLI or with a wrangler.toml. This leads to all kinds of confusing things. For example, why do I need to specify a binding on wrangler pages dev? It would be supercool if Pages would work more like workers. I create a folder, can do all the config I do in the UI for setting up there including all the config I normally have for workers and then deploy like that....

Redirect rules not working for my case

Hi team, i tried to redirect one of my domain page to another domain page by using redirect rules, when i applied rules it's showing successfully applied but while we testing in browser it's not redirecting, Kindly guide me how to do this...
No description

APNG's are not working

https://8f42856c.avrig.pages.dev/ The APNG files simply do not render, and visiting their URL shows a broken image/result. The other images (jpg/png) work fine. Is cloudflare doing some weird mutations/changes to my images which causes them to break? The images work fine locally, or when deploying the build folder manually to a new cloudflare pages application - as seen here: https://avr-demo.pages.dev/assets/system-24888369.apng...
No description

Pages Dashboard not loading

We are currently having issues with the dashboard displaying once we click into one of our pages projects. It seems like the request to pull the deployments is failing on the server side and responding with a 504 - the request is using the following params for the deployments api route: /deploysments?page=1&per_page=15&sort_by=create_on&sort_order=desc. I'm suspecting it may be due to the number of deployments we currently have, but I am not 100% sure. This is a bit of a blocker and we are l...

Make stack trace use the provided sourcemap (single file, [[path]].js + .map)

I have configured a build that yields a functions/[[path]].js and a functions/[[path]].js.map file. How do I make cloudflare actually use the sourcemap so I can read and unsterand them when an error happens? Currently for my small project I am just hitting a webhook with the stacktrace that sends the stacktrace as a telegram to me but most of the time they are not really readable....

How to add .env variables when deploying from github

Hi, one quick question: 1. I have a React application done using Vite. 2. In github there is a .env-example file that in development is copied to an .env 3. But when I deploy to pages there is no way to add a production .env ...

Minecraft SRV Record

Hello all, I was screwing around with the DNS records for a minecraft server of mine, but I could not get the SRV-record to work. Does anyone have some more explanation on how it works and what might be an issue?

Images are not showing after deployment

After deploying my website successfully on cloudfare pages, i found that the images are not showing except the background image, and have tried deploying locally and other platform like vercel it work perfectly. Please how can i resolve it taking a while...

Get Sourcemap for compiled _worker.js (i.e. /functionsWorker-<random>.js)

When I use workers and set no_bundle=true I know excactly what the actual files are gonna look like and can upload sourcemaps to sentry. For pages I have a _worker.js file, can I get the final files somehow?

How to use hyperdrive with Pages _worker.js?

How to bind hyperdrive to a cloudflare page using _worker.js? I read this material https://developers.cloudflare.com/pages/platform/functions/bindings/ but it seems use of hyperdrive not yet not indicated here. Is there a workaround?

Deploying Cloudflare Pages site using Terraform

Good morning all. Apologies if I am using the wrong section for this question. New user only joined moments ago. Im trying to build a pages site using terraform. My code creates the pages project and settings, however it does not trigger a deployment. I was curious if anyone had this issue previously or have I just missed a config setting? Appreciate any advice please..I must have missed something in the docs.. If it helps this is my code: ```resource "cloudflare_pages_project" "blog_pages_project" { account_id = var.cloudflare_account_id name = "blog"...

How can I connect to a postgres database?

I'm trying to connect to my postgres database through node-postgres but it fails because of required node dependencies. ```typescript import { PRIVATE_DATABASE_URL } from '$env/static/private'; import pg from "pg"; import { drizzle } from "drizzle-orm/node-postgres";...

Deprecation warnings when deploying to CFP from GitLab CI/CD

I typically deploy to Cloudflare Pages from GitHub Actions, but am currently doing so from GitLab CI/CD. The CFP-relevant parts of my .gitlab-ci.yml script (https://github.com/brycewray/hugo-site/blob/main/.gitlab-ci.yml) are:
- npm install -g wrangler --unsafe-perm=true
- wrangler pages deploy ./public --project-name=$PROJECT_NAME --branch "main"
- npm install -g wrangler --unsafe-perm=true
- wrangler pages deploy ./public --project-name=$PROJECT_NAME --branch "main"
...