-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async_hooks cannot be used in browser #81
Comments
cc @jacoblee93 related to |
Oh shoot 😬 Will see if we can add web entrypoints to mitigate this I suppose. |
Hey @jacoblee93 having the same issue, tring to use langgraphjs in react-native app, and nextjs. |
Thank you for nudging - will try my best to look this week! |
@jacoblee93 I'm also running into this. It happens when my NextJS imports a file that also imports @demchuk-alex making the frontend only import my types and not langgraph solved my problem |
Oh thanks @davidfant you mean do not import like compile() {
..... some code
return new Pregel({
nodes,
input: `${this.entryPoint}:inbox`,
output: END,
hidden,
checkpointer,
});
} where Pregel calls |
Yeah exactly that. The solution I'm thinking of is to add a separate Pregel class that doesn't use hooks for web. Only issue is that it's super convenient for tracing 😕 |
Agree @jacoblee93 or pass some param to compile to turn off tracing for web or pass your tracing something like that 👍 |
Sorry when I say tracing it also affects things like |
@jacoblee93 fair enough 👍 |
Hey @jacoblee93 sorry for nudging again :) did you have a chance to make it available for web ? Thanks |
Still on the TODO list - sorry for the delay. |
So fair to say lang graph js does not work in the browser currently? |
I'm using chat_agent_executor_with_function_calling
The same code deno can run, but react cannot run in the browser
node -v
v21.7.0
expo
C:\xxxxx\node_modules@langchain\langgraph\dist\setup\async_local_storage.js:5 Uncaught TypeError: _async_hooks.AsyncLocalStorage is not a constructor
at initializeAsyncLocalStorageSingleton (C:\xxxxx\node_modules@langchain\langgraph\dist\setup\async_local_storage.js:5:2)
at new Pregel (C:\xxxxxt\node_modules@langchain\langgraph\dist\pregel\index.js:159:51)
at StateGraph.compile (C:\xxxxx\node_modules@langchain\langgraph\dist\graph\state.js:90:13)
at C:\xxxxx\page\tool\index.tsx:164:21
at loadModuleImplementation (C:\xxxxx\node_modules\metro-runtime\src\polyfills\require.js:282:19)
at guardedLoadModule (C:\xxxxx\node_modules\metro-runtime\src\polyfills\require.js:182:1)
at metroRequire (C:\xxxxx\node_modules\metro-runtime\src\polyfills\require.js:91:43)
at C:\xxxxx\App.js:4:44
at loadModuleImplementation (C:\xxxxx\node_modules\metro-runtime\src\polyfills\require.js:282:19)
at guardedLoadModule (C:\xxxxx\node_modules\metro-runtime\src\polyfills\require.js:182:1)
The text was updated successfully, but these errors were encountered: