cloudflare timeot

I used Better in my Hono Backend. And this is my auth file. import { betterAuth } from "better-auth"; import { drizzleAdapter } from "better-auth/adapters/drizzle"; import * as schema from "../schema"; import { bearer } from "better-auth/plugins"; import { db } from "../../turso"; import { sendResetLink } from "./mailer"; export const auth = betterAuth({ emailAndPassword: { enabled: true, autoSignIn: true, sendResetPassword: async ({ user, url }) => { await sendResetLink(user.email, url); }, }, plugins: [bearer()], database: drizzleAdapter(db(), { provider: "sqlite", schema: { ...schema, user: schema.user, }, }) }) type Session = typeof auth.$Infer.Session and import { Hono } from "hono"; import { auth } from "./lib/auth"; const api = new Hono() api.get('/', async (c) => { return c.json({ success: true }) }) api.on(["POST", "GET"], "/auth/**", (c) => auth.handler(c.req.raw)); export default api But console error/ ✘ [ERROR] service core:user:my-app: Uncaught Error: Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, perform this operation within a handler. https://developers.cloudflare.com/workers/runtime-apis/handlers/
Cloudflare Docs
Handlers
Methods, such as fetch(), on Workers that can receive and process external inputs.
1 Reply
Prestgg
PrestggOP3w ago
@admin Please help me

Did you find this page helpful?