Next.js Discord

Discord Forum

langchain not compatible with Next.js 14.2.x and causing error in server component rendering

Unanswered
ayan posted this in #help-forum
Open in Discord
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 an 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 shows up 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.

0 Replies