Skip to content

Want to skip the docs? Check out pandamastery.com - the best way to learn Panda CSS

Ship the library

Troubleshooting

Manifest errors, include mistakes, and type exports when shipping a library.

Most of these are a missing panda lib output, a package listed in the wrong config field, or a bundler inlining styled-system types.

Manifest errors

design_system_manifest_not_found
design_system_manifest_not_exported

The installed package has no ./panda/* export.

# in the library
panda codegen && panda lib
pnpm publish
# in the app
pnpm install

design_system_export_missing is the same class of bug for ./css or ./recipes. Rebuild with panda lib.

design_system_peer_range_unsatisfied means the app's Panda major does not match the package. Upgrade them together.

The library is in include

design_system_in_include
// ❌
export default defineConfig({
  include: ['src/**/*.{ts,tsx}', '@acme/ds']
})
 
// ✅
export default defineConfig({
  designSystem: '@acme/ds',
  include: ['src/**/*.{ts,tsx}']
})

A path glob into the package (./node_modules/@acme/ds/src/**) triggers no error but re-extracts source the manifest already covers. Remove it too. See Monorepo workflow.

Fallback files will not publish

design_system_files_not_publishable

panda lib inferred re-extract paths that package.json "files" would drop. Pass the files you actually publish:

panda lib --files './**/*.{js,mjs}'

panda lib overwrote an export

design_system_export_overwritten

Let panda lib own ./panda/* and the styled-system subpaths. Keep "." (and ./styles.css if you ship one).

Could not resolve styled-system

ERROR: Could not resolve "../styled-system/xxx"

The generated extension does not match what the bundler resolves. Set outExtension:

panda.config.ts

export default defineConfig({
  outExtension: 'js'
})

Mark styled-system specifiers as external when you bundle the library. If a DTS bundler treats a local styled-system folder as input, named types disappear from your .d.ts.

A re-exported type is undefined

StyleContextProvider, a recipe variant type, or a component prop type resolves to undefined.

  1. Confirm the type imports directly from the generated styled-system package.
  2. Put types first on every conditional export. panda lib writes that shape. Do not reorder it.
  3. Stop inlining styled-system into the library's declaration bundle. Let consumers resolve it from node_modules.

For the annotation that keeps CSS out of .d.ts, see Isolated declarations.

Yarn PnP

Set nodeLinker: node-modules in .yarnrc.yml. Generated styled-system does not resolve under PnP's strict linking.

Still stuck?

panda doctor
panda debug

See Diagnostics and Debugging. GitHub Discussions (opens in a new tab) and Discord (opens in a new tab).

Edit this page on GitHubView as markdown
Last updated on