Has anyone successfully set up a LangGraph cloud deployment in a PNPM monorepo where the agent is in a workspace? I go around in circles, running into failed deployments as the build doesn’t run pnpm I in the root directory and isn’t able to resolve shared packages in the workspace.
Hey, I am also developing using same monorepo + pnpm. I am able to run everything on local. But it does fail on deployment. I am not sure what is the issue, but it constantly fails, sometime with no logs at all.
+1 for having issues with the monorepo packages when deployed
+1; their existing dockerlines
override in the config leaves much to be desired
Would love to be able to build an image for a revision in our own CI/CD
+1 I’m having similar issues. Shared packages are not persisted in the build when trying to deploy.
Thanks for adding your feedback, Nick. We are actively working on this and will hopefully have a solution soon. We plan to support monorepos by allowing files outside of the langgraph.json directory to be included in the container prior to the build process.
Thanks. Is there any work around to this?
For now, the best options are to (a) have agents each in their own repository connected to LangGraph Platform as individual deployments, or (b) use a monorepo but ensure that all code/packages needed by the agent live below the place in the directory structure where langgraph.json lives.
This made me have to move away from langgraph for now unfortunately. We got into the startup program and can’t even use it
I’m trying to implement what you described (b), with langgraph.json at the root of our monorepo, but we’ve hit multiple build errors when our app gets deployed to langgraph platform. We have a pnpm monorepo with a directory structure like the following:
pnpm-workspace.yaml
langgraph.json
/packages
/apps
/web
/langgraph-server
/src
langgraph.json:
{
"node_version": "20",
"dockerfile_lines": [],
"dependencies": ["./apps/langgraph-server"],
"graphs": {
"agent": "./apps/langgraph-server/src/react_agent/graph.ts:graph"
},
"auth": {
"path": "./apps/langgraph-server/src/auth.ts:auth"
},
"env": "./apps/langgraph-server/.env"
}
Our langgraph app has the following as a dev script in package.json
:
( cd ../.. && npx @langchain/langgraph-cli dev )
^All of the above works great locally, and everything plays and starts up nicely together.
However, when we deploy we hit:
[INFO] ERROR: build step 14 "langchain/hosted-langgraph-api-build" failed: step exited with non-zero status: 2
[INFO] ERROR
[INFO] Finished Step #14
[INFO] Step #14: Error: Only 'node' engine is supported in package.json engines. Got engines: ['node', 'pnpm']
We do specify a minimum pnpm version in our root package.json:
"engines": {
"node": ">=20.18",
"pnpm": ">=9.15"
}
After removing “engines” (we do need this property), the build hits a separate breaking issue, it can’t resolve / didn’t install the langgraph app’s package.json dependencies:
[ERROR] Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@langchain/langgraph-sdk' imported from /deps/<REPO-NAME>/apps/langgraph-server/src/auth.ts
at packageResolve (node:internal/modules/esm/resolve:873:9)
I was able to get a deployment working inside of our existing repository, but without any of the pnpm monorepo features (eg: installing workspace:*
packages via pnpm).
I just nested the langgraph app like you’d expect (with langgraph.json in the nested dir rather than root), and pointed the deployment to ./apps/langgraph-server/langgraph.json
. It “works”, but it’s essentially just nesting a disconnected folder inside of our repo.
Obviously not satisfactory, but it’s at least a way to keep the langgraph code inside of a single repository, if that was annoying for anyone else.
@scrowder Is there any movement on this? This is a major blocker now for us as there seem to be no valid workaround.