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

LangChain not compatible with Next.js 14.2.x and causing error in server component rendering. #65140

Closed
metaloozee opened this issue Apr 28, 2024 · 1 comment
Labels
bug Issue was opened via the bug report template. locked

Comments

@metaloozee
Copy link

metaloozee commented Apr 28, 2024

Link to the code that reproduces this issue

https://github.com/metaloozee/quickvid

To Reproduce

  1. Start the application using pnpm dev
  2. Try submitting any kind of form and click on the Submit button

NOTE: The error will only show if you are in the development environment.

Current vs. Expected behavior

I've recently integrated langchain into my Next.js project following their installation guide. However, it appears that langchain is not yet compatible with Next.js version 14.2.x. It functions seamlessly with Next.js version 14.1.x.

The issue arises with a peculiar error stating that a class component is being rendered in a server component, despite the absence of any class components in my codebase. My project exclusively employs client components, which are rendered within the app directory of the app.

Interestingly, everything works as expected when I build the project and run it using the start command. However, the error consistently manifests when I run the project using dev --turbo, particularly after submitting any form within the project.

For form functionality, I utilize ui/shadcn along with zod and react-hook-forms.

image

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home Single Language
Binaries:
  Node: 20.11.1
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.1.4
  eslint-config-next: 13.0.0
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

@metaloozee metaloozee added the bug Issue was opened via the bug report template. label Apr 28, 2024
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked
Projects
None yet
Development

No branches or pull requests

1 participant