Skip to content

Can't import Starlight types #3182

Open
@ematipico

Description

@ematipico

What version of starlight are you using?

0.34.2

What version of astro are you using?

5.7.4

What package manager are you using?

pnpm

What operating system are you using?

Mac

What browser are you using?

Firefox

Describe the Bug

There are two bugs:

  • starlightRoute isn't typed when using the Route Data middleware. @HiDeoo suggested adding astro.config.ts to the include section of tsconfig.json. This could be described somewhere in the docs.
  • When using Route Data via middleware, it is possible to do all sorts of things, including modifying the sidebar. The page shows the types, however some of these types are internal and can't be imported in userland e.g. SidebarEntry. If it's possible, the documentation should explain how to do so.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-kx6exhhl?file=astro.config.mjs,src%2FrouteData.ts,tsconfig.json&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions