Skip to content

Code highlighting no longer works #5061

@theogravity

Description

@theogravity

Describe the bug

I'm using [email protected] and haven't updated it in a few months and noticed recently that the code highlighting no longer works. It seems to work on initial render but then loses the highlighting immediately after.

The documentation site for 2.x for this also has broken behavior as well. I wonder if there's some issue with Shiki itself:

Image

https://vitepress.dev/guide/markdown#syntax-highlighting-in-code-blocks

Reproduction

Visit https://vitepress.dev/guide/markdown#syntax-highlighting-in-code-blocks as an example.

I've replicated this in Edge, Chrome, Mobile Safari on both MacOS / iOS / Windows.

Expected behavior

Code should have highlighting.

System Info

System:
    OS: macOS 15.5
    CPU: (12) arm64 Apple M2 Max
    Memory: 88.16 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.16.0 - /Users/theo/.nvm/versions/node/v22.16.0/bin/node
    Yarn: 1.22.22 - /Users/theo/.nvm/versions/node/v22.16.0/bin/yarn
    npm: 10.9.2 - /Users/theo/.nvm/versions/node/v22.16.0/bin/npm
    pnpm: 10.20.0 - /Users/theo/Library/pnpm/pnpm
    bun: 1.1.27 - /Users/theo/.bun/bin/bun
    Deno: 2.2.8 - /Users/theo/.deno/bin/deno
    Watchman: 2025.04.28.00 - /opt/homebrew/bin/watchman
  Browsers:
    Brave Browser: 140.1.82.172
    Chrome: 143.0.7499.110
    Firefox: 137.0.1
    Safari: 18.5
  npmPackages:
    vitepress: 1.6.4 => 1.6.4

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    need more infoFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions