ReferenceError: Cannot access 'pg' before initialization
Hi everyone,
I love prisma.
I use it with my react-router project, but I recently started to migrate to tanstack start. the project is a monorepo managed with pnpm and turborepo
prisma schema and types are in a shared library called "@myproj/db"
on the tanstack project, it works in development, but when I try to build and preview I see "ReferenceError: Cannot access 'pg' before initialization"
any idea what happens here?
the portion of code that throws the error is this:
3 Replies
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into
#ask-ai if you get antsy for a second opinion!It is difficult to predict what might be going wrong before seeing the setup.
Are you using the latest prisma version?
Yes. Latest prisma version 6.19.0
before seeing the setup.what setup do you need to see?