Skip to content
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

Issue: error occurred when building langgraph as the browser target using webpack #869

Open
Aarebecca opened this issue Feb 18, 2025 · 1 comment

Comments

@Aarebecca
Copy link

Aarebecca commented Feb 18, 2025

I attempted to develop an application running on the browser side based on langgraph.js. However, node:async_hooks was used in langgraphjs/libs/langgraph/src/setup/async_local_storage.ts:

import { AsyncLocalStorage } from "node:async_hooks";

Which causing an error during webpack building. The prompt was:

ERROR in node:async_hooks
Module build failed: UnhandledSchemeError: Reading from "node:async_hooks" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

Perhaps it's possible to consider changing node:async_hooks to async_hooks.

import { AsyncLocalStorage } from "async_hooks";

In this way, I can configure webpack to alias async_hooks to a local implementation to bypass the issue.

My webpack version is: 5.97.1

@HonmaMeikodesu
Copy link

I am not sure but maybe this doc can help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants