lucasp
lucasp
Explore posts from servers
CDCloudflare Developers
Created by lucasp on 10/4/2024 in #pages-help
Error cache
hello im getting this error, someone knows whats happend?
import { auth } from '@/auth'
import { getUser } from '@/client/services/user.service'
import Home from '@/components/pages/Home'
import { redirect } from 'next/navigation'

export const runtime = 'edge'

export default async function Main() {
const session = await auth()

const user = await getUser(session?.user?.localId ?? '')

if (!user?.cargo_giver) redirect('/profile')

return <Home />
}
import { auth } from '@/auth'
import { getUser } from '@/client/services/user.service'
import Home from '@/components/pages/Home'
import { redirect } from 'next/navigation'

export const runtime = 'edge'

export default async function Main() {
const session = await auth()

const user = await getUser(session?.user?.localId ?? '')

if (!user?.cargo_giver) redirect('/profile')

return <Home />
}
server side exception and when check logs "logs": [ { "message": [ "Error: The 'cache' field on 'RequestInitializerDict' is not implemented." ],
1 replies
CDCloudflare Developers
Created by lucasp on 9/26/2024 in #workers-help
any way to use the binding with hono without passing the service url?
I am using several workers and I would like to use one as a gateway and communicate with all of them through service bindings, but is there a way to use the service binding without passing the full URL of the other service? I attach the example
const app = new Hono<{ Bindings: { USERS_WORKER: Fetcher } }>();

app.get("/", async (c) => {
const res = await c.env.USERS_WORKER.fetch("/");

const data = await res.json();

console.log(data);

return c.text("Hello Hono!");
});
const app = new Hono<{ Bindings: { USERS_WORKER: Fetcher } }>();

app.get("/", async (c) => {
const res = await c.env.USERS_WORKER.fetch("/");

const data = await res.json();

console.log(data);

return c.text("Hello Hono!");
});
i get this error ✘ [ERROR] TypeError: Invalid URL: / only works if i set the url like this const res = await c.env.USERS_WORKER.fetch("http://localhost:8787/"); But since I have several workers, I'd need to define many variables and I'd like to know if there's a way to save myself that step.
8 replies
CDCloudflare Developers
Created by lucasp on 9/2/2024 in #workers-help
problem with d1 locally
No description
3 replies