CF Function only works locally (Astro)

I am trying to print to console on a button press with a Cloudflare function in an SSR Astro project. When using npx wrangler pages dev -- npm run dev it works, but when deployed I get <empty string> in the console and a 404 in the Network tab, even though I can see the functions directory builds (or at least builds without error) correctly. The Cloudflare function logs do not pick up any activity on click.

What am I doing wrong?

// ASTRO CONFIG
export default defineConfig({
  integrations: [tailwind({
    applyBaseStyles: true
  }), react()],
  output: "server",
  adapter: cloudflare({
    mode: "directory"
  }),
});
// CLOUDFLARE ROUTING CONFIGURATION IN CONSOLE

{
  "routes": [
    {
      "routePath": "/helloworld",
      "mountPath": "/",
      "method": "",
      "module": [
        "helloworld.js:onRequest"
      ]
    },
    {
      "routePath": "/:path*",
      "mountPath": "/",
      "method": "",
      "module": [
        "[[path]].js:onRequest"
      ]
    }
  ],
  "baseURL": "/"
}
// CLOUDFLARE  invocation routes in console
{
  "version": 1,
  "include": [
    "/",
    "/blog",
    "/_image",
    "/projects",
    "/bookmarks"
  ],
  "exclude": []
}