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

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?...

Help With _routes.json File

Hello, I am a bit confused by the _routes.json file. I have added the file to my functions directory with the following config: ```json { "version": 1, "include": ["/*"],...

segmentation fault when building Astro site

It always ends at this file: ``` 13:12:45.488 12:12:45 ā–¶ /_astro/tenhult_lake_1Bgy5U.webp (before: 303kB, after: 6kB) (+223ms) (107/263) 13:12:45.858 Segmentation fault 13:12:45.871 Failed: Error while executing user command. Exited with error code: 139...

Fetching Objects in a Cloudflare R2 Bucket on Astro

I'm trying to allow people to go to https://example.com/assets/asset.png and for the server to fetch the object asset.png from the bucket. I am able to grab the object but I'm having trouble responding to the request with the object. I would use s3 api, but I might aswell use the wrangler api since im already using it for d1. Any help would be much appreciated!

How to set environment variables via `wrangler pages deploy` per deployment?

I managed to deploy a project with wranger pages deploy, but a function that is included there requires an environment variable - and optimally I could set that per deployment. Is that a thing for Pages? Or do I have to set it via the UI for all preview deployments?

Deployment logs to understand `Status: Failed`?

I have some deployments via wrangler pages deploy that in theory should work (they work fine locally via wrangler dev), but after deploy I only see Status: Failed in the web UI for that deployment. I could not find any deployment logs. Am I overlooking something?...

Use `pg` in Pages Function?

I want to access a PostgreSQL database in a function that will be deployed via Cloudflare Pages. Workers supports using pg, the common Node PostgreSQL database. But I can not make it work with the Functions in Pages. I get errors like this on pnpm wrangler pages dev . -: ``` ✘ [ERROR] Could not resolve "events"...

Deploying Pages using Wrangler - returning deployment URL

Hey, I'm currently working on CI/CD pipeline. I've created the following script based on Cloudflare's GitHub Action: ``js await exec.exec(npx wrangler pages deploy "build" --project-name="${process.env.CLOUDFLARE_PROJECT_NAME}" --branch="${branch}" --commit-hash="${commitHash}" --commit-message="${commitMessage}"`); ...

custom install command

the default command bun install --frozen-lockfile throw errors: ``` āÆ bun install [0.03ms] ".env.local"...

Logpush / Cloudflare Pages / SvelteKit

I'm testing out Logpush. I have an R2 bucket set up but I'm not sure how to get logs sent to it. The docs mention creating and configuring a wrangler.toml file, but I don't think my SvelteKit projects even use that wrangler.toml file. Any insight on this?

Custom Domain with Cloudflare zero trust

Hi, I'm trying to setup Cloudflare Pages with a custom domain. I want to restrict the site to certain people, so i configured a policy which ALLOWS access to people with a certain email adress. On the overview tab of zero trust I set up the application domain's which end with *.pages.dev. However, I am unable to select a custom domain (abc.xyz.com) which is configured via CNAME: "Zone is not associated with the current account" The access page shows up correctly - but with the custom domain I can access the site directly....
No description

Pages Functions limit consumed for no reason?

Hey, I'm unsure if it's the right place but anyways, I've recently received an email from Cloudflare saying that I've surpassed the daily Cloudflare Worker and/or Pages Functions limit. I have no worker setup, nor any functions set up with my pages. I've received a DDoS attack around the time I reached the limit, is there any way that WAF or something else could make this limit rise?

environment variable

I defined a Environment Variables on the dashboard Variable name = SERVER_URL, Value = server.xxx.com In my code I use const serverURL = env.SERVER_URL or ENV.SEREVER_URL to call this variable that was defined on the dashboard but the console will show env, ENV is not defined. ...

How do you get the current path in Pages?

It looks like __dirname causes a 500 execption. There is no wrangler file for Pages to set the Node JS compatibility to use path.resolve()...

pages functions middleware help

I have issue with middleware, i need to change in middleware authorization header from response, to use it in next requests in /api folder, but it doesnt changing.
No description

Can't build a production build as of a week ago

pages.dev: frontend-3u4.pages.dev Deployment id: 343e7953-9625-4fa9-b3a5-827aef818f7c Account ID: c88cb57346c0e015906cd66fed611a8a Error received:...

doesnt detect css

my directory structure of repository assets/ content/ gen/ static/...

Deploying Nuxt to Pages - path errors

Hi, During deployment, I get the following errors: [error] [nitro] Error: Could not load /opt/buildhome/repo/dist/dist/server/styles.mjs (imported by node_modules/nuxt/dist/core/runtime/nitro/renderer.js): ENOENT: no such file or directory, open '/opt/buildhome/repo/dist/dist/server/styles.mjs'...

ERR_SSL_PROTOCOL_ERROR on Cloudflare Pages Hosted Custom Domain

I am having an issue hosting my Cloudflare pages site. I have check the forums, and tried changing to all the recommended settings from those posts. The Pages domain I am connecting the brotero.tv domain to is broterotv.pages.dev and that website is working perfectly. Any help is appreciated!...
No description

hrefs missing quotes

On my local Hugo instance all href links are surrounded with quotes (e.g. <a hrefs="https://example.com">example</a> But when I render the same repo on Pages, the hrefs are missing the quotes (e.g. <a hrefs=https://example.com>example</a> Is this a configure setting issue or due to something else?...