langgraph-cli dev error : Top-level await is currently not supported with the "cjs" output format #212

Closed
opened 2026-02-15 17:17:24 -05:00 by yindo · 1 comment
Owner

Originally created by @jhau on GitHub (Mar 23, 2025).

Hi
When I tried running the langgraph-cli dev command, I get the following error,

info: ▪ Starting server...
info: ▪ Initializing storage...
info: ▪ Registering graphs from /Users/jeff/work/ai-chat/open-mcp-client/agent-ts
info: ┏ Registering graph with id 'sample_agent'
info: ┗ [1] { graph_id: 'sample_agent' }
error: ▪ Error: Transform failed with 1 error:
/Users/jeff/work/ai-chat/open-mcp-client/node_modules/.pnpm/pkce-challenge@4.1.0/node_modules/pkce-challenge/dist/index.node.js:5:9: ERROR: Top-level await is currently not supported with the "cjs" output format

The pkce-challenge package is a dependency of :

@langchain/mcp-adapters 0.3.3
└─┬ @modelcontextprotocol/sdk 1.7.0
└── pkce-challenge 4.1.0

Any help on resolving this issue is much appreciated!

Originally created by @jhau on GitHub (Mar 23, 2025). Hi When I tried running the langgraph-cli dev command, I get the following error, info: ▪ Starting server... info: ▪ Initializing storage... info: ▪ Registering graphs from /Users/jeff/work/ai-chat/open-mcp-client/agent-ts info: ┏ Registering graph with id 'sample_agent' info: ┗ [1] { graph_id: 'sample_agent' } error: ▪ Error: Transform failed with 1 error: /Users/jeff/work/ai-chat/open-mcp-client/node_modules/.pnpm/pkce-challenge@4.1.0/node_modules/pkce-challenge/dist/index.node.js:5:9: ERROR: Top-level await is currently not supported with the "cjs" output format The pkce-challenge package is a dependency of : @langchain/mcp-adapters 0.3.3 └─┬ @modelcontextprotocol/sdk 1.7.0 └── pkce-challenge 4.1.0 Any help on resolving this issue is much appreciated!
yindo closed this issue 2026-02-15 17:17:24 -05:00
Author
Owner

@dqbd commented on GitHub (Jul 7, 2025):

Hello! This does seem to indicate that you're trying to run the graph in CJS mode. Make sure to either

  1. Add "type": "module" in your package.json
  2. Rename your graph file from agent.ts to agent.mts
@dqbd commented on GitHub (Jul 7, 2025): Hello! This does seem to indicate that you're trying to run the graph in CJS mode. Make sure to either 1) Add `"type": "module"` in your `package.json` 2) Rename your graph file from `agent.ts` to `agent.mts`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#212