Skip to content

fix: move katex CSS import from client component to root layout - #301

Open
Hanhai Zou (zouhanhai) wants to merge 1 commit into
langchain-ai:mainfrom
zouhanhai:fix/katex-css-import
Open

fix: move katex CSS import from client component to root layout#301
Hanhai Zou (zouhanhai) wants to merge 1 commit into
langchain-ai:mainfrom
zouhanhai:fix/katex-css-import

Conversation

@zouhanhai

Copy link
Copy Markdown

Problem

import "katex/dist/katex.min.css" from markdown-text.tsx (client component) causes Next.js 15.5+ to fail with:

Module parse failed: Unexpected character '@' (1:0)
File was processed with: next-flight-css-loader

Both next dev and next start return 500.

Fix

Move CSS import from client component to root layout (server component). Next.js processes CSS correctly in server components via the regular CSS pipeline.

Verification

  • next build → passes
  • Page loads → 200 OK

…ex.min.css from a client component\n(markdown-text.tsx) causes Next.js flight-css-loader to fail with:\n"Module parse failed: Unexpected character '@'"\n\nMoving the import to layout.tsx (server component) allows Next.js\nto process the CSS correctly via the regular CSS pipeline.
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

Hanhai Zou (@zouhanhai) is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant