Skip to content

Setting Astro build.format config breaks sidebar links #180

@jamescmartinez

Description

@jamescmartinez

What version of starlight are you using?

0.1.2

What version of astro are you using?

2.6.1

What package manager are you using?

npm

What operating system are you using?

Mac

What browser are you using?

Chrome

Describe the Bug

Expected: sidebar links should not have a trailing slash when setting Astro's build.format config to file

Actual: they have a trailing slash, which causes the links to 404 in production builds

How to reproduce:

  1. Clone the build-format-file branch of this repo
  2. Comment out line 8 of the Astro config that sets the base path to /docs (sorry, it's a temporary workaround for GitHub pages)
  3. npm run dev to see the trailing / OR npm run build && npm run preview to get the 404s
  4. Click any link in the sidebar
  5. Smile at everyone's favorite sad piece of paper :)
Screenshot 2023-06-08 at 5 40 36 PM

Link to Minimal Reproducible Example

https://github.com/mergentlabs/docs/tree/build-format-file

Participation

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

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