ITADN

@shikijs/vitepress-twoslash renders some special code blocks incorrectly.

#1267Openajiho 创建于 2026-03-21
A
ajihocommented
### Validations - [x] Follow our [Code of Conduct](https://github.com/shikijs/shiki/blob/main/CODE_OF_CONDUCT.md) - [x] Read the [Contributing Guide](https://github.com/shikijs/shiki/blob/main/CONTRIBUTING.md). - [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. ### Describe the bug Can work normally: ```ts twoslash console.log('hello') // ^? ``` Cannot read properties of undefined (reading 'children') ```ts twoslash // @errors: 1005 let a = (4 ``` <img width="1060" height="589" alt="Image" src="https://github.com/user-attachments/assets/9e5643c3-31b5-45d4-be7e-e6b8afe4de27" /> This requirement should be reasonable, as the code comes from the official documentation of TypeScript: [https://www.typescriptlang.org/docs/handbook/typescript-from-scratch.html#syntax](https://www.typescriptlang.org/docs/handbook/typescript-from-scratch.html#syntax) The expected result should be as shown in the figure below: <img width="1225" height="188" alt="Image" src="https://github.com/user-attachments/assets/6b1a6b3e-ed0f-4144-917b-33d3f610ca15" /> ### Reproduction https://stackblitz.com/edit/vite-sycfvqmv?file=docs%2Fexample.md Clicking the **Get Started** button will result in an error. ### Contributes - [x] I am willing to submit a PR to fix this issue - [ ] I am willing to submit a PR with failing tests
0 条评论