7 Replies
You need to run your code in
app/page.ts
or app/api/route.ts
rather than something like component/component.ts
. Basically the code needs to be run on the server, not the clientIf you check the Next JS starter, it will show you the proper way to make these calls https://xata.io/docs/getting-started/nextjs
Get started with Next.js and Xata
Get started with Next.js and Xata
Let me try your suggestion @Enemykite
The sample gallery app is also a good place to check. You'll see that xata is only used server side, in the app folder (which are server side), not the components (which are client side). https://github.com/xataio/sample-nextjs-chakra-gallery-app
GitHub
GitHub - xataio/sample-nextjs-chakra-gallery-app: Gallery applicati...
Gallery application built with Xata, Next.js and Chakra UI - GitHub - xataio/sample-nextjs-chakra-gallery-app: Gallery application built with Xata, Next.js and Chakra UI
I used Vite for Next.js boilerplate.
I need help
hey @teri. what do you need help with. i don't have access to your code so you'll need to give me some details about where you're running into trouble
I have fixed it from the previous error message I had in this channel.