(cross posting from Clerk) I have an Astro project deployed to Cloudflare Pages. I have a requirement to add authentication to some areas of the site. I've added the Cloudflare adapter and the Clerk integration as per the docs. I was able to get everything up and running as I wanted locally, but when I deploy to Cloudflare, the deployment fails with the error:
Error: Failed to publish your Function. Got error: Uncaught Error: No such module "node:async_hooks". at _astro-internal_middleware.mjs:4262:33 in createAsyncLocalStorage at _astro-internal_middleware.mjs:4265:30
Error: Failed to publish your Function. Got error: Uncaught Error: No such module "node:async_hooks". at _astro-internal_middleware.mjs:4262:33 in createAsyncLocalStorage at _astro-internal_middleware.mjs:4265:30
I've tried all sorts to get this working such as experimenting with configs (cloudflare, vite, clerk), moving middleware file around, installing wranlger, using a wrangler.toml with node compat