Troubleshooting
What to do if you run into issues with zjkm-ui-ai-elements.
Why are my components not styled?
Check the styles setup: your CSS must import Tailwind, the package's
styles.css (or your own shadcn theme), and point @source at
node_modules/zjkm-ui-ai-elements/dist.
Markdown in messages has no styling
Add the two streamdown @source lines from the styles setup. With pnpm,
streamdown isn't hoisted, so hoist it or point the paths into node_modules/.pnpm/node_modules/.
Plain borders look too dark
styles.css sets the default border colour for elements with a plain border class. If you
skip that import, make sure your own theme sets border-color: var(--border) in its base layer,
as shadcn/ui's default theme does.
Theme switching doesn't work — my app stays in light mode
The components follow the .dark class on an ancestor (usually <html>), as shadcn/ui does. Use a
theme switcher that toggles that class, such as next-themes with attribute="class".
The component imports fail with "module not found"
Import each component from its own path, for example zjkm-ui-ai-elements/message; there is no
root import. The shadcn/ui primitives are at zjkm-ui-ai-elements/ui/<name>. Your bundler and
TypeScript must support package exports (moduleResolution set to bundler, node16 or
nodenext).
Server-rendering a component crashes in React Router or Astro
The canvas component imports React Flow's stylesheet. Frameworks that keep dependencies external
during server rendering can't load CSS files from node_modules; add the package to
ssr.noExternal in your Vite config.