Cloudflare deployment with better auth issues

Setup with basic environment variables and bun using this template (https://github.com/dotnize/tanstarter). Deploying to cloudflare pages using the presets from Tanstack Start hosting documentation.

server: {
    preset: 'cloudflare-pages',
    unenv: cloudflare,
  },


Everything built and deployed as expected.

19:10:36.098 | [success] [vinxi] Nitro Server built


When I go to the site and click 'sign in with [provider]' I get a 500 error. The functions logs for
/api/auth
say:

      "message": [
        "# SERVER_ERROR: ",
        "Error: proxy request failed, cannot connect to the specified address"
      ],


Which seems that the endpoint is not there/not being deployed to functions.

It doesn't seem to be any issue with environment variables or build issues that I have seen in the discord.


It was recommended to use this setup (https://github.com/nekochan0122/tanstack-start-with-cf-pages-env-vars/blob/main/app.config.ts) but that seems counter to the direction required in the docs. I am wondering if anyone has more up to date information on deploying to Cloudflare.
GitHub
Contribute to nekochan0122/tanstack-start-with-cf-pages-env-vars development by creating an account on GitHub.
Hosting is the process of deploying your application to the internet so that users can access it. This is a critical part of any web development project, ensuring your application is available to the...
Was this page helpful?
Cloudflare deployment with better auth issues - TanStack