Skip to content

Dev server enters broken state with HTMLElement is not defined after MDX edit when using <Tabs> #16626

@filipfalcon

Description

@filipfalcon

What version of starlight are you using?

0.38.5

What version of astro are you using?

6.2.2

What package manager are you using?

Bun

What operating system are you using?

macOS

What browser are you using?

Brave

Describe the Bug

Editing any MDX file in the docs collection puts the Astro dev server into a broken state when <Tabs> is reachable from the module graph (even via the @astrojs/starlight/components barrel).

Vite issues a program reload, then errors with ReferenceError: HTMLElement is not defined while evaluating Starlight's Tabs.astro in the Node SSR module runner — specifically the client <script> block at line 146 (class StarlightTabs extends HTMLElement).

The cold start is fine. The crash happens only on subsequent reloads, and the dev server stays broken (browser stops responding to further edits) until the process is restarted.

Link to Minimal Reproducible Example

https://github.com/kotkoroid/starlight-prerender-node-reload-bug

Participation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)pkg: astroRelated to the core `astro` package (scope)pkg: cloudflareRelated to the Cloudflare adapter

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions