Chroma JS Client Fails in Next.js (Build Error)

Share
Workaround available JavaScript, Next.js Updated November 15, 2026How we research

Quick answer

The default embedding function uses @huggingface/transformers, which Next.js cannot bundle. Wrap your config with withChroma.

Most likely fix: Wrap the config

How to fix it

Try these in order — the most common fix is first.

  1. 1. Wrap the config

    1. Open next.config.ts
    2. import { withChroma } from "chromadb"
    3. export default withChroma(nextConfig)
    Did this fix it?

Symptoms

Build or runtime failures when importing the chromadb JS client in a Next.js project.

Why it happens

  • Next.js fails to bundle @huggingface/transformers used by the default embedding function

This guide also covers

  • chromadb nextjs error
  • chroma js client next.js build

Still not working?

If Chroma keeps failing, you're not alone. See every Chroma problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

Other Chroma errors

All 11 Chroma errors and fixes →