Skip to content

Build fails with duplicate export default when used with starlight-scroll-to-top #2

Description

@gesslar

Description

When starlight-codeblock-fullscreen (v0.1.4) is used alongside starlight-scroll-to-top (v0.4.0), the build fails with a Duplicate export "default" error in the bundled page script.

Reproduction

astro.config.mjs:

import starlight from '@astrojs/starlight';
import starlightScrollToTop from 'starlight-scroll-to-top';
import starlightCodeblockFullscreen from 'starlight-codeblock-fullscreen';

export default defineConfig({
  integrations: [
    starlight({
      plugins: [
        starlightScrollToTop(),
        starlightCodeblockFullscreen(),
      ],
      // ...
    }),
  ],
});

npm run build output:

[ERROR] [vite] ✗ Build failed in 13ms
astro:scripts/page.js (1624:0): Duplicate export "default"
file: astro:scripts/page.js:1624:0

1622: }
1623:
1624: export default initECFullscreen;
      ^

Environment

  • starlight-codeblock-fullscreen: 0.1.4
  • starlight-scroll-to-top: 0.4.0
  • @astrojs/starlight: 0.38.2
  • astro: 6.0.1
  • Node: 24.14.0

Notes

  • Removing either plugin resolves the issue — the conflict is specifically between these two.
  • Both plugins appear to inject scripts into the page, and the bundler merges them into astro:scripts/page.js with conflicting export default statements.
  • starlight-heading-badges (v0.7.0) works fine alongside both plugins individually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions