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

qs library breaks Edge builds #54

Closed
jacoblee93 opened this issue Jul 11, 2023 · 5 comments
Closed

qs library breaks Edge builds #54

jacoblee93 opened this issue Jul 11, 2023 · 5 comments

Comments

@jacoblee93
Copy link

This qs library generally has some things that aren't supported in edge environments in a downstream dependency:

test-exports-vercel:build: Failed to compile.
test-exports-vercel:build: 
test-exports-vercel:build: ../node_modules/function-bind/implementation.js
test-exports-vercel:build: Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime 
test-exports-vercel:build: Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation
test-exports-vercel:build: 
test-exports-vercel:build: Import trace for requested module:
test-exports-vercel:build: ../node_modules/function-bind/implementation.js
test-exports-vercel:build: ../node_modules/function-bind/index.js
test-exports-vercel:build: ../node_modules/get-intrinsic/index.js
test-exports-vercel:build: ../node_modules/side-channel/index.js
test-exports-vercel:build: ../node_modules/@anthropic-ai/sdk/node_modules/qs/lib/stringify.js
test-exports-vercel:build: ../node_modules/@anthropic-ai/sdk/node_modules/qs/lib/index.js
test-exports-vercel:build: ../node_modules/@anthropic-ai/sdk/core.mjs
test-exports-vercel:build: ../node_modules/@anthropic-ai/sdk/index.mjs
test-exports-vercel:build: ../langchain/dist/chat_models/anthropic.js
test-exports-vercel:build: ../langchain/chat_models/anthropic.js
test-exports-vercel:build: ./src/entrypoints.js
test-exports-vercel:build: 
test-exports-vercel:build: 
test-exports-vercel:build: > Build failed because of webpack errors

Would love to replace it with an alternative - it's a blocker on langchain-ai/langchainjs#1932.

@jacoblee93
Copy link
Author

@rattrayalex
Copy link
Collaborator

rattrayalex commented Jul 11, 2023

Hey @jacoblee93, this has been resolved on the Next.js side in vercel/next.js#52009 – is that sufficient for your needs?

Some additional background in vercel/next.js#51910 if it's helpful (it documents a workaround for users on older versions of Next)

@jacoblee93
Copy link
Author

Wild! Ok, will see what we can do on our end. Thank you!

@rattrayalex
Copy link
Collaborator

Great! If you think version incompatibilities will be a big issue, let me know and we'll see what we can do.

@jacoblee93
Copy link
Author

Bumping next in our build test seems to have fixed it, all good. Thanks for the quick response!

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