-
Notifications
You must be signed in to change notification settings - Fork 221
Reading from "node:crypto" is not handled by plugins #225
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
Comments
Googling your error message, this looks like a known issue with webpack. the fix appears to be telling webpack about this using externals.
|
Any updates? I tried the My env: |
I guess the replicate package is not for interacting with Replicate API in browser. So I need to use HTTP API. |
Edited to correct Replicate package version FWIW ~ I'm seeing the same error. I am using Turborepo for a few web apps, all Next.js projects. I am using this Replicate client + the Vercel AI SDK. It was working OK until I tried some workarounds but haven't solved it yet... (also, I'm using Yarn for dependency management but doubt that makes a difference) |
@lucasishuman which package is v0.2.7? I am considering downgrade Replicate client. |
Sorry, I mistyped the Replicate version... Replicate v0.26.0 currently runs and builds fine for me so am I am using that for now. Replicate v0.27.0+ will not build and shows the |
Related: #210 |
Using Next 14.4.2 and PNPM here. Solved here by editing the webpack: (config) => {
config.externals.push({
'node:crypto': 'commonjs crypto',
});
return config;
}, |
@leonardofaria - that worked for me, thanks. |
Although... this did not work once deployed to my production environment (on Vercel)
So back to v0.26.0 for now... |
What's the nodejs version you are setting? I should be 18, or better 20 |
I just removed the Here you can see how I made it: https://github.com/run-llama/LlamaIndexTS/pull/731/files#diff-0a946a42f586de9c04be9cfe31eec6a8ff9d14721b79565958dd13458ab9260e |
Looks good locally as well as deployed on Vercel using Node 18.x - thanks a ton! |
Atleast it worked for now |
Environment:
Node Version: 20.11.1
macOS: 14.2.1
next: 14.1.3
replicate: 0.28.1
I am getting
Module build failed: UnhandledSchemeError: Reading from "node:crypto" is not handled by plugins (Unhandled scheme).
while building my project.pnpm build
command is causing the issue butpnpm dev
(developer mode) works fine.The text was updated successfully, but these errors were encountered: