"node:os" Error with Astro site using BetterAuth

I am trying to deploy my Astro template which uses Better Auth. The preview deployment succeeds but when I visit the preview page I am getting a 500 error. From the real-time logs:
[ERROR] Error: No such module "node:os". imported from "chunks/auth_DvzfQAcs.mjs"
https://astro-starter-arr.pages.dev/ Preview deployment ID: d838cad6-cbe0-4291-8c83-baf2835a80df Account ID: e1e7d3e8a8cbe65e27a2efebecea9cd0 Source code of the app: https://github.com/4rays/astro-starter/ I am not familiar with the status of node compatibility of CF workers and I'd appreciate if anyone can give me pointers. Ultimately I would like to figure out if swapping dependencies could get around this or not.
GitHub
GitHub - 4rays/astro-starter: A starter template for Astro.
A starter template for Astro. Contribute to 4rays/astro-starter development by creating an account on GitHub.
3 Replies
kaishin
kaishinOP2mo ago
While not addressing the issue directly, deploying to Workers with static assets works fine for the exact same site.
kaishin
kaishinOP2mo ago
I delete the pages site for now to avoid name conflicts. The state in which I got the error is in the cloudflare branch: https://github.com/4rays/astro-starter/tree/cloudflare
GitHub
GitHub - 4rays/astro-starter at cloudflare
A starter template for Astro. Contribute to 4rays/astro-starter development by creating an account on GitHub.
kaishin
kaishinOP2mo ago
I will go ahead with Workers + assets for the time being as it seems more suitable for this project anyway.

Did you find this page helpful?