Issue with Prisma export in Turborepo + Express setup
Hey everyone đź‘‹
I'm running into an issue with my Turborepo setup that includes Prisma and Express.js.
When I try to start my dev server with npx turbo dev, I get the following error:
The requested module does not provide an export named 'prisma'
Here’s some context:
I have a @repo/db package where my Prisma client is initialized and exported like this:
In my Express app (in another package), I import it like this:
The code compiles fine, but when running the dev command through Turborepo, it crashes with that export error.
It seems like Turborepo (or maybe Node’s ESM handling) isn’t recognizing the named export from my Prisma module.
Has anyone else run into this issue?
Any idea if it’s related to module resolution between packages or how ESM/CJS is configured in Turborepo?
Thanks in advance 🙏
my repo: https://github.com/SpinBoxx/prisma-monorepo
GitHub
GitHub - SpinBoxx/prisma-monorepo
Contribute to SpinBoxx/prisma-monorepo development by creating an account on GitHub.
3 Replies
You decided to hold for human wisdom. We'll chime in soon! Meanwhile,
#ask-ai is there if you need a quick second opinion.
its a very simple fix
see packages/database
Rename 'ts.config.json' to 'tsconfig.json'
You added an extra dot there