You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use <Tabs> and <TabItem> components within that file
Create a new custom component and import that within the aforementioned .mdx file
Run pnpm build && pnpm preview (I'll come back to why not to use pnpm dev in a bit)
Notice that the tabs are clickable and work as expected
Within that newly created custom component import Starlight's <Icon> component (essentially using this custom component as a wrapper). (Note: there doesn't seem to be any special issues with the <Icon> component from what I can tell, this is able to be reproduced with other imported components as well)
Now run pnpm build && pnpm preview again. You will notice those tab items are no longer clickable.
Notes
This bug only happens on production builds and works as expected while in dev mode (pnpm dev)
It works as expected in Astro versions 2.8.5 and before, it is broken in 2.9.0 and beyond
What version of
astro
are you using?2.10.4
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Mac
What browser are you using?
Safari
Describe the Bug
Reproduction Steps
.mdx
file in Starlight<Tabs>
and<TabItem>
components within that file.mdx
filepnpm build && pnpm preview
(I'll come back to why not to usepnpm dev
in a bit)<Icon>
component (essentially using this custom component as a wrapper). (Note: there doesn't seem to be any special issues with the<Icon>
component from what I can tell, this is able to be reproduced with other imported components as well)pnpm build && pnpm preview
again. You will notice those tab items are no longer clickable.Notes
pnpm dev
)2.8.5
and before, it is broken in2.9.0
and beyond<Tabs>
components don't seem to be getting their needed<script>
's added in the production buildFiles to pay attention to the repro
.mdx
file: https://github.com/lorenzolewis/starlight-component-bug/blob/main/src/content/docs/guides/example.mdxWhat's the expected result?
The
<Tab>
components and their respective JS should be included in the production buildLink to Minimal Reproducible Example
https://github.com/lorenzolewis/starlight-component-bug
Participation
The text was updated successfully, but these errors were encountered: