Skip to content

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

Closed

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.

Activity

  1. gesslar commented on Mar 31, 2026

    @gesslar
    Author

    FIRST!!!!!!!!!!!

  2. frostybee commented on Apr 7, 2026

    @frostybee
    Owner

    @gesslar Thanks for letting me know! It has been fixed in v1.0.0

    However, please note that I may archive this plugin in favor of https://frostybee.github.io/expressive-code-fullscreen/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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