Shiki Theme Changes Not Reflected in Content Collection #12700
Labels
- P2: has workaround
Bug, but has workaround (priority)
feat: content collections
Related to the Content Collections feature (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When changing the
theme
value withinshikiConfig
in theastro.config.mjs
file, the Shiki theme updates correctly and instantly on Pages. However, the theme does not change for code blocks in posts generated from the Content Collection. Additionally, hot reload stops functioning for the Content Collection after modifyingastro.config.mjs
.To Reproduce
Create an Astro project with at least one Markdown post in the
src/content
directory.Add a code block to both a Page and a Markdown post.
Configure Shiki in
astro:config:mjs
:Start the development server (
astro dev
).Observe that the code blocks on both the Pages and the post use the
github-dark
theme.Change the
theme
value inastro.config.mjs
to a different theme (e.g.,github-light
).Observe that the theme updates on the Page but not on the post.
Make a change to the Markdown content of the post and save. Observe that hot reload does not reflect the changes.
What's the expected result?
The Shiki theme should update instantly on both Pages and Content Collection posts when the
theme
value inastro.config.mjs
is changed. Hot reload should continue to function correctly for the Content Collection after modifyingastro.config.mjs
.Workaround
Deleting the
data-store.json
file from the.astro
directory and restarting the development server temporarily resolves the issue. Shiki themes then change correctly on all content, and hot reload functionality is restored.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-k8fzhwqy
Participation
The text was updated successfully, but these errors were encountered: