Next.js Discord

Discord Forum

Fetch API abstraction next 13

Unanswered
Western yellowjacket posted this in #help-forum
Open in Discord
Avatar
Western yellowjacketOP
I want to create an abstraction for fetch API in next 13. So I created an AuthService (outside the next 13 project, in a share folder, this is a turborepo monorepo) and I'm calling it inside page.tsx

The problem is that { cookies } from 'next/headers' is giving an error, because it assumes its parent its a client component.
Image
Image

0 Replies