Skip to content

Type declarations import from shiki, but shiki is only a devDependency #562

Description

@rudolfminasyan16

Bug Description

Summary

streamdown re-exports types from shiki in its published type declarations, but shiki is only listed as a devDependency instead of a dependency (or peerDependency).

This means that anyone using streamdown and running TypeScript type checking will get a "Cannot find module 'shiki'" error unless they install the shiki package themselves.

The tricky part is that they don't actually use shiki directly, and streamdown already bundles it into its runtime build. In practice, users end up installing a large package solely to satisfy TypeScript.

Version

streamdown@2.5.0

Evidence

dist/index.d.ts (lines 9-10):

import { BundledTheme, ThemeRegistrationAny, BundledLanguage } from 'shiki';
export { BundledLanguage, BundledTheme, ThemeRegistrationAny } from 'shiki';

package.json:

"devDependencies": {
  "shiki": "^3.19.0"
}

Steps to Reproduce

  1. In a fresh repo, npm i streamdown@2.5.0 (do not install shiki).
  2. Import anything from streamdown in a .ts file.
  3. Run tsc.

Expected Behavior

Type-checking succeeds without installing shiki separately.

Actual Behavior

tsc fails to resolve the shiki module referenced by streamdown own
declarations.

Code Sample

Streamdown Version

2.5.0

React Version

18.2.0

Node.js Version

No response

Browser(s)

No response

Operating System

None

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions