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

Cant fetch Stripe checkout session line items with Stripe lib or fetch, not returning any errors

Request verification is working fine since I updated to use both webCrypto = Stripe.createSubtleCryptoProvider() and
httpClient: Stripe.createFetchHttpClient() (though latter is now obsolete/unnecessary and verification works without it) ...

Github integration after deploying with Wrangler

I deployed directly with wrangler, and would now like to deploy preview branches automatically. Cloudflare already has access to my gh account (I have the app). If I push the repo up it's not clear to me how cloudflare will identify and deploy it. I don't see a way to configure this in the CF dashboard....

Is possible to run migrations in Pages build command?

I'm not sure what is the right flow to run D1 migrations... If I understand it correctly so far, you have to: Push migrations with a command: npx wrangler d1 migrations apply db-name as a wrangler command from the local env to make changes in the prod. DB and then push the changed app code (wich rely on new DB schema) to git. ...

Is there a way to connect to D1 locally in, say, a Nuxt.js app in dev mode?

I tried running wrangler pages dev --proxy [nuxt dev server port] -- pnpm dev but the context.cloudflare and process.env.[DB_BINDING] don't seem to exist when I try to access them in defineEventHandler(). I read the documentation but I'm still not clear on how exactly to approach this. Any guidance or examples would be appreciated. My wrangler.toml has [[d1_databases]] and everything and I'm logged in.

Cloudflare Pages logs when using `wrangler pages deploy`

Hi, I'm using wranger pages deploy to deploy a Sveltekit project. However, I get a failed deployment: https://fdb56b0e.dts-root.pages.dev/ In the dashboard, the Deployment details say Status: Failed. How can I see logs? The docs say that they are in the Build tab, however, I'm not using the cloudflare ci. I only see an "Assets uploaded" tab instead. Account Id: ea55617474d57857ada364854771fa83...

Unable to serve private CF images

Got a SvelteKit app, and I'm trying out CF images. Upload was nice and easy, but actually serving the images is proving to be a bit of a nightmare I've follow the docs here:...

React App with Vite, Github Actions and Wrangler

Hi guys, a question when using the cf cli, in my worflow of a github action for the deploy I have to define the environment variables that I use in my project, this because Vite resolves those import.meta.env vars at compile time and literally replaces them with the values, right?

Is it possible to use npm run dev instead of pages:dev?

Is it possible to use npm run dev instead of using pages:dev? The pages:dev builds the project every time you save which is really bad DX. If not. Do you guys know any way to mimic the KV store locally? We are struggling quiet a bit getting this to work properly. We are using SvelteKit....

How do ignore submodule repository git clones?

I'm getting a build error because the submodule repository is private. I want pages git clone to ignore it.

Pages not crawled by Google

How do I allow Cloudflare to public Pages to Google please. Thank you.

Changing a GitHub project to a Direct Upload project

Right now, one of my websites uses the GitHub integration to upload builds, but I want to switch to using Direct Upload. How can I do this?

If the header doesn't include cf-connecting-ip, is it a bot?

I'm doing the service through pagesveltekit, but there are often 500 internal server errors. However, neither error stack nor undefined have cf-related headers in the request headers. How did you get to this?...

Fix 1014 CNAME Cross-User Banned with Cloudflare for SaaS

Hello Cloudflare Community! We need your help and hints on solving our case. The initial conditions are: * Two Cloudflare accounts:...

The creation of new pages projects has a 500 error.

```json { "result": null, "success": false, "errors": [...

Bug Report: like to Cloudflare Pages app on GitHub is broken for organizations

I'm trying to deploy a new repo on Pages, and I need to give this repo access to the Cloudflare Pages app. The link doesn't work though. This is what is currently linked: https://github.com/settings/installations/<id> This is what it should link to instead:...
No description

Configuring Exclude routes for NitroServer on NuxtJS

I am currently trying to add an "exclude":["/api/*] to my auto generated _routes.json but I cant quite seem to get my nuxt.config.ts dialed in and not sure what I am doing wrong. based on the documentation, I added a ```...

Cloudflare Pages Jekyll Deployment failing on production after latest update

Looks like cloudflare updated it bundler version for jekyll pages deployment, all our build our now failing. We're using build system v2. Anyone else? Executing user command: jekyll build 12:32:16.897 /opt/buildhome/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.3.15/lib/bundler/definition.rb:486:in `materialize': Could not find sass-embedded-1.66.1 in any of the sources (Bundler::GemNotFound)...

Can Pages serve dynamic content? (Nuxt.js)

Hey there, I'm a bit confused as to what exactly is supported by Pages. The docs state that dynamic / SSR frameworks like Next and Nuxt are supported; but I'm having trouble understanding how I'm supposed to configure the app to actually serve correctly. For example, I've got a Nuxt (v2) app that I'm building with nuxt build. It spits out a .nuxt folder that looks like this (see image). The framework expects that the folder is served with nuxt start. How do I configure Pages to do that? Is that even supported? I tried both direct upload via Wrangler (my preferred method) and the direct git integration. I thought maybe by specifying the framework in the latter method the app would configure itself to serve Nuxt assets. I get a plain http 404 response code when trying to access the deployed app. Additional note - I'm aware that I can serve the Nuxt app in full static mode by uploading the dist folder (created via nuxt generate). But that's not what I want in this case; I specifically want to use the dynamic app....
No description

running code on preview destruction?

We need to add our preview urls to our auth system dynamically, and want to remove them after they’re merged or closed. Is there any way to run a job or hook when a preview is torn down?

Caching to save on request quota

Hi, We are developing an API powered by Pages and Functions. We get many requests with the same parameter which get the same response every time (but they can't be served statically). Is it possible to cache the response based on the url and params to save on requests quota?...