EmptyChannelError with LanGraph.js on NextJS in production on Vercel #40

Closed
opened 2026-02-15 17:06:01 -05:00 by yindo · 5 comments
Owner

Originally created by @marcbordessoule on GitHub (Jun 25, 2024).

I want to build a conversational agent based on LangGraph.js

I took the example from the official LangGraph.js home page: [https://github.com/langchain-ai/langgraphjs]
(addConditionalEdges, checkpointer with MemorySaver())

Which I pasted in the 'official' example of the "LangChain + Next.js Starter" template
[https://github.com/langchain-ai/langchain-nextjs-template]

It works very well in local dev :-)

But when executing the graph on production with with Vercel
when invoke()), after the execution of the LLM node, just before the processing of 'shouldContinue'
I have this message :

EmptyChannelError: 
    at (node_modules/@langchain/langgraph/dist/channels/ephemeral_value.js:56:0)
    at (node_modules/@langchain/langgraph/dist/channels/base.js:21:0)
    at (node_modules/@langchain/langgraph/dist/pregel/index.js:388:49)
    at (node_modules/@langchain/core/dist/runnables/base.js:293:0)
    at (node_modules/@langchain/langgraph/dist/pregel/index.js:525:0)
    at (node_modules/@langchain/core/dist/utils/stream.js:96:38) {
  name: 'EmptyChannelError'
}

After consulting the forums issues #220, #180 and #113, I added in next.config.js

config.optimization.minimize = false;
And

    experimental: {
    serverComponentsExternalPackages: ['@langchain/langgraph'],
  },

But I still get the same error: EmptyChannelError.

I use the following versions of LangChain.js
"@langchain/community": "^0.2.13",
"@langchain/core": "0.2.9",
"@langchain/langgraph": "^0.0.24",

Does anyone have a simple example of integrating LangGrap.js into NextJs in production on Vercel?

Thanks.

Originally created by @marcbordessoule on GitHub (Jun 25, 2024). I want to build a conversational agent based on LangGraph.js I took the example from the official LangGraph.js home page: [https://github.com/langchain-ai/langgraphjs] (addConditionalEdges, checkpointer with MemorySaver()) Which I pasted in the 'official' example of the "LangChain + Next.js Starter" template [https://github.com/langchain-ai/langchain-nextjs-template] It works very well in local dev :-) But when executing the graph on production with with Vercel when invoke()), after the execution of the LLM node, just before the processing of 'shouldContinue' I have this message : ``` EmptyChannelError: at (node_modules/@langchain/langgraph/dist/channels/ephemeral_value.js:56:0) at (node_modules/@langchain/langgraph/dist/channels/base.js:21:0) at (node_modules/@langchain/langgraph/dist/pregel/index.js:388:49) at (node_modules/@langchain/core/dist/runnables/base.js:293:0) at (node_modules/@langchain/langgraph/dist/pregel/index.js:525:0) at (node_modules/@langchain/core/dist/utils/stream.js:96:38) { name: 'EmptyChannelError' } ``` After consulting the forums issues #220, #180 and #113, I added in next.config.js ` config.optimization.minimize = false;` And ``` experimental: { serverComponentsExternalPackages: ['@langchain/langgraph'], }, ``` But I still get the same error: EmptyChannelError. I use the following versions of LangChain.js "@langchain/community": "^0.2.13", "@langchain/core": "0.2.9", "@langchain/langgraph": "^0.0.24", Does anyone have a simple example of integrating LangGrap.js into NextJs in production on Vercel? Thanks.
yindo closed this issue 2026-02-15 17:06:01 -05:00
Author
Owner

@jacoblee93 commented on GitHub (Jun 25, 2024):

Looking into this now!

@jacoblee93 commented on GitHub (Jun 25, 2024): Looking into this now!
Author
Owner

@jacoblee93 commented on GitHub (Jun 25, 2024):

Yes, I'm able to repro. Investigating further...

@jacoblee93 commented on GitHub (Jun 25, 2024): Yes, I'm able to repro. Investigating further...
Author
Owner

@jacoblee93 commented on GitHub (Jun 25, 2024):

Fixed in 0.0.25 (at least with my test case) - thank you for reporting!

@jacoblee93 commented on GitHub (Jun 25, 2024): Fixed in 0.0.25 (at least with my test case) - thank you for reporting!
Author
Owner

@bioshazard commented on GitHub (Jun 27, 2024):

Wow @jacoblee93 , I can't believe I am seeing you again in an issue 2 days ago fixing a problem I just ran into that I only noticed in production after making full use of that LangGraph Web entrypoint you enabled just before I wanted to try it. I ran into this vague error, found it from google, and I can confirm upgrading from 0.0.23 to 0.0.25 remediated my issue. All that to say thank you so much for this rapid support, it is enabling some awesome solutions in my React frontend!!

@bioshazard commented on GitHub (Jun 27, 2024): Wow @jacoblee93 , I can't believe I am seeing you again in an issue 2 days ago fixing a problem I *just* ran into that I only noticed in production after making full use of that LangGraph Web entrypoint you enabled just before I wanted to try it. I ran into this vague error, found it from google, and I can confirm upgrading from 0.0.23 to 0.0.25 remediated my issue. All that to say thank you so much for this rapid support, it is enabling some awesome solutions in my React frontend!!
Author
Owner

@jacoblee93 commented on GitHub (Jun 27, 2024):

Thanks for the kind words - it was really our bad for not testing post minification in the first place :(

We will aim to be as responsive as possible here!

@jacoblee93 commented on GitHub (Jun 27, 2024): Thanks for the kind words - it was really our bad for not testing post minification in the first place :( We will aim to be as responsive as possible here!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#40