Langgraph supervisor does not work when following docs and installing on fresh agent. #187

Closed
opened 2026-02-15 17:17:00 -05:00 by yindo · 12 comments
Owner

Originally created by @ndrabins on GitHub (Mar 5, 2025).

Details:

Trying to use the new langraph supervisor / swarm agent. Followed the docs and when installed and trying to run with the basic example agent they both throw an error in the lib.

Steps to reproduce:

create new basic agent: npm create langraph
replace basic agent code with code from langraph prebuilt agent example: https://www.npmjs.com/package/@langchain/langgraph-supervisor
run agent with: npx @langchain/langgraph-cli@latest dev

Error:

/node_modules/@langchain/langgraph-supervisor/dist/handoff.js:5
import { Command, getCurrentTaskInput, } from "@langchain/langgraph";
                  ^^^^^^^^^^^^^^^^^^^
SyntaxError: The requested module '@langchain/langgraph' does not provide an export named 'getCurrentTaskInput'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:213:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at resolveGraph (/Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/graph/load.utils.mjs:21:19)
    at async file:///Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/graph/load.mjs:28:39
    at async Promise.all (index 0)
    at async registerFromEnv (file:///Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/graph/load.mjs:23:12)
    at async startServer (file:///Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/server.mjs:65:5)
    at async Promise.all (index 0)
    at async file:///Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/cli/entrypoint.mjs:22:45

For whatever reason it doesn't see getCurrentTaskInput as exported. Not sure what the issue is as I see its committed in the lib and I tried updating all the langchain/langraph libs to latest but it still throws an error.

One thing that would be great for libs like these is adding it to the CLI for starting agents.

Originally created by @ndrabins on GitHub (Mar 5, 2025). Details: Trying to use the new langraph supervisor / swarm agent. Followed the docs and when installed and trying to run with the basic example agent they both throw an error in the lib. Steps to reproduce: create new basic agent: `npm create langraph` replace basic agent code with code from langraph prebuilt agent example: https://www.npmjs.com/package/@langchain/langgraph-supervisor run agent with: `npx @langchain/langgraph-cli@latest dev` Error: ``` /node_modules/@langchain/langgraph-supervisor/dist/handoff.js:5 import { Command, getCurrentTaskInput, } from "@langchain/langgraph"; ^^^^^^^^^^^^^^^^^^^ SyntaxError: The requested module '@langchain/langgraph' does not provide an export named 'getCurrentTaskInput' at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21) at async ModuleJob.run (node:internal/modules/esm/module_job:213:5) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at resolveGraph (/Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/graph/load.utils.mjs:21:19) at async file:///Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/graph/load.mjs:28:39 at async Promise.all (index 0) at async registerFromEnv (file:///Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/graph/load.mjs:23:12) at async startServer (file:///Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/server.mjs:65:5) at async Promise.all (index 0) at async file:///Users/dawggydawg/.npm/_npx/8b41b8d3955bcda6/node_modules/@langchain/langgraph-api/dist/cli/entrypoint.mjs:22:45 ``` For whatever reason it doesn't see `getCurrentTaskInput` as exported. Not sure what the issue is as I see its committed in the lib and I tried updating all the langchain/langraph libs to latest but it still throws an error. One thing that would be great for libs like these is adding it to the CLI for starting agents.
yindo added the langgraph-supervisor label 2026-02-15 17:17:00 -05:00
yindo closed this issue 2026-02-15 17:17:00 -05:00
Author
Owner

@ndrabins commented on GitHub (Mar 5, 2025):

@vbarda yes, 0.2.53

Notably though, when using the CLI it creates the default agent with "@langchain/langgraph": "^0.2.43"

@ndrabins commented on GitHub (Mar 5, 2025): @vbarda yes, 0.2.53 Notably though, when using the CLI it creates the default agent with `"@langchain/langgraph": "^0.2.43"`
Author
Owner

@jacoblee93 commented on GitHub (Mar 5, 2025):

This seems like a version mismatch

Can you try these instructions to set resolutions but for @langchain/langgraph instead of @langchain/core?

https://langchain-ai.github.io/langgraphjs/how-tos/manage-ecosystem-dependencies/

@jacoblee93 commented on GitHub (Mar 5, 2025): This seems like a version mismatch Can you try these instructions to set resolutions but for `@langchain/langgraph` instead of `@langchain/core`? https://langchain-ai.github.io/langgraphjs/how-tos/manage-ecosystem-dependencies/
Author
Owner

@ndrabins commented on GitHub (Mar 5, 2025):

Just tried on a fresh agent and no luck. Here is my package.json

  "name": "example-graph",
  "version": "0.0.1",
  "description": "A starter template for creating a LangGraph workflow.",
  "packageManager": "yarn@1.22.22",
  "main": "my_app/graph.ts",
  "author": "Your Name",
  "license": "MIT",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "tsc",
    "clean": "rm -rf dist",
    "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathPattern=\\.test\\.ts$ --testPathIgnorePatterns=\\.int\\.test\\.ts$",
    "test:int": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathPattern=\\.int\\.test\\.ts$",
    "format": "prettier --write .",
    "lint": "eslint src",
    "format:check": "prettier --check .",
    "lint:langgraph-json": "node scripts/checkLanggraphPaths.js",
    "lint:all": "yarn lint & yarn lint:langgraph-json & yarn format:check",
    "test:all": "yarn test && yarn test:int && yarn lint:langgraph"
  },
  "dependencies": {
    "@langchain/core": "^0.3.42",
    "@langchain/langgraph": "^0.2.53",
    "@langchain/langgraph-supervisor": "^0.0.8",
    "@langchain/openai": "^0.4.4"
  },
  "resolutions": {
    "@langchain/langgraph": "^0.2.53",
    "@langchain/core": "^0.3.42"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3.1.0",
    "@eslint/js": "^9.9.1",
    "@tsconfig/recommended": "^1.0.7",
    "@types/jest": "^29.5.0",
    "@typescript-eslint/eslint-plugin": "^5.59.8",
    "@typescript-eslint/parser": "^5.59.8",
    "dotenv": "^16.4.5",
    "eslint": "^8.41.0",
    "eslint-config-prettier": "^8.8.0",
    "eslint-plugin-import": "^2.27.5",
    "eslint-plugin-no-instanceof": "^1.0.1",
    "eslint-plugin-prettier": "^4.2.1",
    "jest": "^29.7.0",
    "prettier": "^3.3.3",
    "ts-jest": "^29.1.0",
    "typescript": "^5.3.3"
  }
}
@ndrabins commented on GitHub (Mar 5, 2025): Just tried on a fresh agent and no luck. Here is my package.json ```{ "name": "example-graph", "version": "0.0.1", "description": "A starter template for creating a LangGraph workflow.", "packageManager": "yarn@1.22.22", "main": "my_app/graph.ts", "author": "Your Name", "license": "MIT", "private": true, "type": "module", "scripts": { "build": "tsc", "clean": "rm -rf dist", "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathPattern=\\.test\\.ts$ --testPathIgnorePatterns=\\.int\\.test\\.ts$", "test:int": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathPattern=\\.int\\.test\\.ts$", "format": "prettier --write .", "lint": "eslint src", "format:check": "prettier --check .", "lint:langgraph-json": "node scripts/checkLanggraphPaths.js", "lint:all": "yarn lint & yarn lint:langgraph-json & yarn format:check", "test:all": "yarn test && yarn test:int && yarn lint:langgraph" }, "dependencies": { "@langchain/core": "^0.3.42", "@langchain/langgraph": "^0.2.53", "@langchain/langgraph-supervisor": "^0.0.8", "@langchain/openai": "^0.4.4" }, "resolutions": { "@langchain/langgraph": "^0.2.53", "@langchain/core": "^0.3.42" }, "devDependencies": { "@eslint/eslintrc": "^3.1.0", "@eslint/js": "^9.9.1", "@tsconfig/recommended": "^1.0.7", "@types/jest": "^29.5.0", "@typescript-eslint/eslint-plugin": "^5.59.8", "@typescript-eslint/parser": "^5.59.8", "dotenv": "^16.4.5", "eslint": "^8.41.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-no-instanceof": "^1.0.1", "eslint-plugin-prettier": "^4.2.1", "jest": "^29.7.0", "prettier": "^3.3.3", "ts-jest": "^29.1.0", "typescript": "^5.3.3" } } ```
Author
Owner

@jacoblee93 commented on GitHub (Mar 5, 2025):

Same error?

And are you in a monorepo by any chance? You will need to set resolutions (or overrides depending on your package manager) at the root and reinstall.

@jacoblee93 commented on GitHub (Mar 5, 2025): Same error? And are you in a monorepo by any chance? You will need to set `resolutions` (or `overrides` depending on your package manager) at the *root* and reinstall.
Author
Owner

@vbarda commented on GitHub (Mar 5, 2025):

just released a new version of langgraph-supervisor - could you try installing in a fresh project again?

@vbarda commented on GitHub (Mar 5, 2025): just released a new version of `langgraph-supervisor` - could you try installing in a fresh project again?
Author
Owner

@jacoblee93 commented on GitHub (Mar 5, 2025):

This new one has @langchain/langgraph as a peer dep and shouldn't require any special consideration for resolutions/overrides outside of just having @langchain/langgraph installed and on latest.

Sorry one moment

@jacoblee93 commented on GitHub (Mar 5, 2025): ~~This new one has `@langchain/langgraph` as a peer dep and shouldn't require any special consideration for `resolutions/overrides` outside of just having `@langchain/langgraph` installed and on latest.~~ Sorry one moment
Author
Owner

@ndrabins commented on GitHub (Mar 5, 2025):

Okay, just tried new agent with 0.0.9 and still getting the same error unfortunately.

Set up a public repo with basic agent and supervisor example code here: https://github.com/ndrabins/langraph-supervisor-test

I also tried with and without resolutions/override for npm/yarn after nuking node modules + lock and doing fresh installs. My env isn't anything specific and no mono repo.

Using node 22.12.0

@ndrabins commented on GitHub (Mar 5, 2025): Okay, just tried new agent with 0.0.9 and still getting the same error unfortunately. Set up a public repo with basic agent and supervisor example code here: https://github.com/ndrabins/langraph-supervisor-test I also tried with and without resolutions/override for npm/yarn after nuking node modules + lock and doing fresh installs. My env isn't anything specific and no mono repo. Using node 22.12.0
Author
Owner

@jacoblee93 commented on GitHub (Mar 5, 2025):

Thanks - still digging. Will fix and make sure it doesn't happen again.

@jacoblee93 commented on GitHub (Mar 5, 2025): Thanks - still digging. Will fix and make sure it doesn't happen again.
Author
Owner

@ndrabins commented on GitHub (Mar 5, 2025):

great, thanks for being responsive and looking into this. Really like this new api for building agents and excited to work with them! Much cleaner and understandable imo.

@ndrabins commented on GitHub (Mar 5, 2025): great, thanks for being responsive and looking into this. Really like this new api for building agents and excited to work with them! Much cleaner and understandable imo.
Author
Owner

@vbarda commented on GitHub (Mar 5, 2025):

We have identified the issue - it is caused by langgraph-cli. will pub an update w/ a fix and post here once it's out

@vbarda commented on GitHub (Mar 5, 2025): We have identified the issue - it is caused by `langgraph-cli`. will pub an update w/ a fix and post here once it's out
Author
Owner

@vbarda commented on GitHub (Mar 11, 2025):

@ndrabins this is fixed in the latest langgraph-cli - could you please reinstall and confirm it's working for you?

@vbarda commented on GitHub (Mar 11, 2025): @ndrabins this is fixed in the latest langgraph-cli - could you please reinstall and confirm it's working for you?
Author
Owner

@benjamincburns commented on GitHub (Mar 13, 2025):

Going to close this as fixed - @ndrabins please @ me if you're still experiencing this issue and I'll reopen.

And thanks for reporting!

@benjamincburns commented on GitHub (Mar 13, 2025): Going to close this as fixed - @ndrabins please @ me if you're still experiencing this issue and I'll reopen. And thanks for reporting!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#187