#Zustand

1 messages · Page 1 of 1 (latest)

gritty kayak
#

How do I use my Zustand store in a server component? I have a component that requires server due to it using Drizzle to fetch from a postgres database, and so using const spValue = useSpStore((state) => state.spValue); will result in an error, and using "use client" will result in error ./node_modules/postgres/src/connection.js:1:0 Module not found: Can't resolve 'net'.

willow urchinBOT
#

Hi @gritty kayak. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Hmm, I don't know enough to give you a confident answer yet. The information extracts provided do not contain specific details on how to use Zustand store in a server component with Drizzle and Postgres. However, they do provide some guidance on how to use Drizzle with Vercel Postgres and how to deploy a Next.js project that connects to Vercel Postgres with Drizzle.

You can refer to the Vercel documentation (https://vercel.com/docs/storage/vercel-postgres/using-an-orm) for more details on this.

For more specific issues related to Zustand or server components, you might want to refer to their respective documentation or community forums.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: