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

I'm having trouble with nested routes in

I'm having trouble with nested routes in page functions... my understanding is that a file at functions/users/friends/index.ts will serve a request to /users/daniel/friends, in theory displaying a list of all the friends of daniel, but Im just getting the root app page instead of function output. Do I need to just use a [[catchall]].ts file at functions/users/[[catchall]].ts and handle all of the logic there, or am I doing something wrong?

so each endpoint runs as a separate

so each endpoint runs as a separate pages function, right?

emails from functions

Hi there, I'm trying to set up my static page's contact form to send me an email with the form data. So I'm trying to do the steps on this page albeit with Functions instead of Workers, but apparently the mimetext package requires Node and attempting to set the node compatibility gives me the same errors when I try to run Wrangler https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/ Is this example in that link just not possible? Or not possible in Functions but maybe possible in a Worker? I'm trying to do this as simply as possible, and I don't need an Airtable. I just want to send myself an email with the form data. I noticed the old pages plugin using a middleware is now deprecated. I'm open to other options....
No description

hi there!

hi there! trying configure Pages from wrangler.toml and having a use-case not already covered by config: monorepo with Vue app at ./frontend/. Pages builder complains about [build] section not valid for Pages. I'd like to set the build settings like this:...

Usually Hugo, but I have successfully

Usually Hugo, but I have successfully set up and used functions in projects that don't use a framework, too. To be slightly more specific, I've managed to get my functions talking with Stripe checkout and Google scripts, but not Respond or Mimetext.

Looking at the linked tutorial, it

Looking at the linked tutorial, it appears that Solid uses SSR. If that is the case, then you need to create that route through whatever mechanism solid provides, rather than the /functions folder

It seems like I always get a MISS for

It seems like I always get a MISS for the same URL I want to cache. Is it something I'm missing? "try { let url = await context.request.url; let paramString = url.split('?')[1]; ...

Thanks for still thinking about it.

Thanks for still thinking about it. Unfortunately, that doesn't work or not at least locally.
It does not return anything as the fetch never completes, so the function just shows 500 internal error on the server but doesn't execute any further. I tried shortcircuit with datares.status to check for 500 but it doesn't work that way as by that time the function errors out and not the origin server (for which datares checks for).
The 500 error is the function error but nothing is checking for the function error itself. I am not sure if I am explaining it well. ...

Cloudflare API Documentation

There is the Traceroute API which requires the Enterprise plan

In my case I got these results:

In my case I got these results: Raw: 6.07 MB Gzipped: 1.05 MB Minified: 2.23 MB...

Hey All, I am trying to understand how

Hey All, I am trying to understand how wrangler page functions deploy works with domain aliases. I have used wrangler to successfully update my page function so when I use the pages.dev link it is working with the correct function, but when I access with the domain alias, sometimes I get the old page function behaviour and sometimes I get the new behaviour. I have tried a cache clear by hostname and it didn't clear out the old page function. Any ideas why the old page function would continue to...

@auth/sveltekit! I have the same issue

@auth/sveltekit! I have the same issue on cf pages functions. ```
Using @sveltejs/adapter-cloudflare
21:38:26.511 ✘ [ERROR] Could not resolve "crypto"...

Quick question around `pages dev`

Quick question around pages dev functions and restarting on code changes. I've got a function that re-exports onRequest from a different folder, and I use the wrangler dev bundling. The details are here: https://discord.com/channels/595317990191398933/1155875351201861632/1192079412615708674 For some reason during dev, codechanges are not applied without having to restart. Is this a bug?...

Pages Functions as API

Hi, looking for some help with functions to help me fetch json data from a third party API. Apologies in advanced if I have got this all wrong, I am usually just front-end but I am helping this animal rescue organisation make their webpage - and to list the animals they have for adoption we are using a third party api that needs a API secret. To hide the API secret from the client-end I went about making an express.js backend that will be hosted and the end points will simply just call the third party API with the secret, and some basic filtering queries will just be appeneded to the fetch. ...
No description

Send emails from a pages function

Heyo 👋 Is it possible to send emails from a pages function? I am trying somewhat along the lines of https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/...

Hey guys, I have a question.

Hey guys, I have a question. I have a nextjs static site, all HTML, js and css. No server side rendering. I want to have the nextjs app generate a bunch of static "websites" for different clients. ...

No Errors for POST Formdata

i am trying to get my function to accept a http POST with formdata and then send that to a webhook to discord. Somehow i am only getting an empty object but also no errors in the logs in the dashboard : ```js /** * POST /api/submit */...

Hey all using SvelteKit in Cloudflare

Hey all, using SvelteKit in Cloudflare Pages/Functions, and running locally via wrangler pages dev -e dev -- vite dev (proxy mode). Unfortunately it seems that a Location header doesn't make it all the way back to my browser but instead wrangler/workerd/mf is following the redirect internally. Is there a way to enable this passthrough? I saw the attached note but not sure if that's the same thing. Strangely, it seems that other SvelteKit headers are passed through, i.e X-Sveltekit-Page, bu...
No description
Next