You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I raised this on Discord, where I was asked to create this issue, so I am x-posting the feature request to GitHub.
Background
When using a NodeJS monorepo such as Turborepo, Lerna, Yarn, NX, etc, it is currently not possible to use DBOS with Prisma. You receive an error that the @prisma/client node module cannot be found.
const{ PrismaClient }=require(path.join(process.cwd(),"node_modules","@prisma","client"));// Find the prisma client in the node_modules of the current project
In various monorepos it is considered best practice to keep the Prisma schema and client in a separate workspace package, and the @prisma/client module itself is often located in the root projects node modules folder.
Expectation
DBOS on Prisma works as normal in monorepos without throwing an error.
What have I tried?
I went ahead and applied a small patch to the aforementioned lines in a Turborepo, and confirmed that it works fine if you let it know where the root of the monorepo is located, as then it is able to locate the @prisma/client correctly. This works for my needs, but I imagine an official solution would be preferred by the community.
If I run into any other issues with monorepos I will let DBOS know, as I am integrating with DBOS for the first time in a Typescript based Turborepo project.
The text was updated successfully, but these errors were encountered:
I raised this on Discord, where I was asked to create this issue, so I am x-posting the feature request to GitHub.
Background
When using a NodeJS monorepo such as Turborepo, Lerna, Yarn, NX, etc, it is currently not possible to use DBOS with Prisma. You receive an error that the @prisma/client node module cannot be found.
This is due to the following lines of code:
dbos-transact-ts/src/dbos-executor.ts
Lines 250 to 252 in 8f0652b
In various monorepos it is considered best practice to keep the Prisma schema and client in a separate workspace package, and the @prisma/client module itself is often located in the root projects node modules folder.
Expectation
DBOS on Prisma works as normal in monorepos without throwing an error.
What have I tried?
I went ahead and applied a small patch to the aforementioned lines in a Turborepo, and confirmed that it works fine if you let it know where the root of the monorepo is located, as then it is able to locate the @prisma/client correctly. This works for my needs, but I imagine an official solution would be preferred by the community.
If I run into any other issues with monorepos I will let DBOS know, as I am integrating with DBOS for the first time in a Typescript based Turborepo project.
The text was updated successfully, but these errors were encountered: