\n\n### Reproduction\n\n{\n \"devDependencies\": {\n \"vitepress\": \"2.0.0-alpha.2\"\n },\n \"scripts\": {\n \"docs:dev\": \"vitepress dev docs\",\n \"docs:build\": \"vitepress build docs\",\n \"docs:preview\": \"vitepress preview docs\"\n }\n}\n\n### Expected behavior\n\n在被注释的代码行后面添加 `// [!code highlight]` 高亮的位置错误。\n\n```js\nexport default {\n data () {\n return {\n // msg1: '1 Highlighted!' // [!code highlight]\n }\n }\n}\n```\n\n\u003Cimg width=\"705\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/f1f5e3ce-3bc6-4939-b199-d9ac120ffab8\" />\n\n\n### System Info\n\n```Text\nChrome: 132.0.6834.160\n```\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [x] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [x] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [x] Read the [docs](https://vitepress.dev).\n- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2892],{"name":2893,"color":2894},"upstream","BF29ED",4546,"代码高亮渲染异常","2025-02-23T04:43:37Z","https://github.com/vuejs/vitepress/issues/4546",0.70178145,{"description":2901,"labels":2902,"number":2904,"owner":2872,"repository":2873,"state":2884,"title":2905,"updated_at":2906,"url":2907,"score":2908},"### Describe the bug\r\n\r\nseparate vite config file is not resolve as expected\r\n\r\n### Reproduction\r\n\r\n// .vitepress/config.ts\r\n\r\n```ts\r\nexport default defineConfig({\r\n srcDir: 'content',\r\n base: BASE_PATH,\r\n outDir: 'dist',\r\n cacheDir: 'cache',\r\n markdown: {\r\n config: (md) => {\r\n md.use(groupIconMdPlugin)\r\n }\r\n },\r\n themeConfig: {\r\n // theme-level options\r\n }\r\n})\r\n```\r\nrunning `DEBUG=vite:config,vite:resolve,vite:debug-alias vitepress dev `\r\n\r\n\r\ndebug info showing vitepress config as expect\r\n```sh\r\n vite:config vitepress: {\r\n vite:config root: '/Users/ayao/repos/vita-ui/packages/docs',\r\n vite:config srcDir: '/Users/ayao/repos/vita-ui/packages/docs/content',\r\n```\r\n\r\nbut separate vite config is not respect(i expect it to be /Users/ayao/repos/vita-ui/packages/docs`\r\n> which is where the script is running and the separate config file `vite.config.ts` root field is config like that\r\n> root: __dirname,\r\n\r\n\r\n```sh\r\n vite:config bundled config file loaded in 34.09ms +0ms\r\n vite:config no config file found. +53ms\r\n vite:config using resolved config: {\r\n vite:config root: '/Users/ayao/repos/vita-ui/packages/docs/content',\r\n vite:config base: '/wiki/',\r\n vite:config cacheDir: '/Users/ayao/repos/vita-ui/packages/docs/cache',\r\n vite:config plugins: [\r\n\r\n```\r\n\r\n\r\nmy viteconfig as following\r\n\r\n```ts\r\nimport { defineConfig, createLogger } from 'vite'\r\nimport path, { resolve } from 'path'\r\nimport { fileURLToPath } from 'node:url'\r\n\r\nimport Components from 'unplugin-vue-components/vite'\r\nimport AutoImport from 'unplugin-auto-import/vite'\r\nimport Inspect from 'vite-plugin-inspect'\r\nimport { groupIconVitePlugin, localIconLoader } from 'vitepress-plugin-group-icons'\r\n\r\n\r\nconst __filename = fileURLToPath(import.meta.url)\r\nconst __dirname = path.dirname(__filename)\r\nconst logger = createLogger();\r\n\r\nexport default defineConfig({\r\n optimizeDeps: {\r\n exclude: [\r\n 'vitepress',\r\n ],\r\n },\r\n logLevel: 'info',\r\n clearScreen: false,\r\n resolve: {\r\n alias: {\r\n \"@utils\": resolve(__dirname, \"./utils\"),\r\n \"@\": resolve(__dirname, \"./content\"),\r\n \"@oss\": resolve(__dirname, \"./oss\"),\r\n }\r\n },\r\n plugins: [\r\n {\r\n name: 'vite:debug-alias',\r\n configResolved(config) {\r\n debugger\r\n logger.info(`Alias config: ${JSON.stringify(config.resolve.alias)}`);\r\n },\r\n resolveId(id) {\r\n if (id.startsWith('@utils')) {\r\n logger.info(`Resolving @utils path: ${id}`);\r\n }\r\n },\r\n },\r\n Inspect({\r\n build: true,\r\n dev: true,\r\n outputDir: '.vite-inspect',\r\n }),\r\n Components({\r\n dirs: [\r\n \"components\",\r\n ],\r\n include: [\r\n /\\.vue$/,\r\n /\\.vue\\?vue/,\r\n ],\r\n dts: \"components.d.ts\"\r\n }),\r\n AutoImport({\r\n imports: [\"vue\", \"@vueuse/core\"],\r\n dirs: [\"composables\"],\r\n vueTemplate: true,\r\n dts: \"auto-imports.d.ts\"\r\n }),\r\n groupIconVitePlugin({\r\n customIcon: {\r\n 'docker': 'vscode-icons:file-type-docker2',\r\n 'k8s': localIconLoader(import.meta.url, './assets/devicon--kubernetes.svg'),\r\n 'dir': localIconLoader(import.meta.url, './assets/mingcute--directory-line.svg'),\r\n 'bnf': localIconLoader(import.meta.url, './assets/file-icons--bnf.svg'),\r\n },\r\n }),\r\n\r\n ],\r\n})\r\n\r\n```\r\n\r\n### Expected behavior\r\n\r\nall my plugin didn't register in merge config\r\n\r\n```sh\r\n plugins: [\r\n vite:config 'vite:optimized-deps',\r\n vite:config 'vite:watch-package-data',\r\n vite:config 'vite:pre-alias',\r\n,,,\r\n ]\r\n```\r\n\r\n\r\n```sh\r\n ~ tree -L 2\r\n├── content\r\n│ └── index.md\r\n├── logs\r\n│ └── debug.log\r\n└── vite.config.ts\r\n├── .vitepress\r\n│ └── config.ts\r\n```\r\n\r\n> one thing to know that the separte vite config is respect if config srcDir to `cwd`(meaning leaving empty with default)\r\n> the separate vite config will be respect and all the plugin is register successfully\r\n> but i prefer flat structure, wish to pull all my markdown file in content direcotry, so i was hoping this issue could be resolve\r\n\r\n\r\n\r\n\r\n### System Info\r\n\r\n```Text\r\n~ npx envinfo --system --npmPackages vitepress --binaries --browsers\r\n\r\n System:\r\n OS: macOS 14.4\r\n CPU: (8) arm64 Apple M1\r\n Memory: 90.00 MB / 8.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.18.1 - ~/n/bin/node\r\n npm: 10.8.2 - ~/n/bin/npm\r\n pnpm: 9.15.2 - ~/n/bin/pnpm\r\n Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman\r\n Browsers:\r\n Chrome Canary: 133.0.6933.0\r\n Safari: 17.4\r\n npmPackages:\r\n vitepress: catalog: => 1.5.0\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2903],{"name":2866,"color":2867},4460,"vite separate config file resolve problem","2025-01-10T04:43:11Z","https://github.com/vuejs/vitepress/issues/4460",0.7020725,{"description":2910,"labels":2911,"number":2913,"owner":2872,"repository":2873,"state":2884,"title":2914,"updated_at":2915,"url":2916,"score":2917},"### Describe the bug\r\n\r\n\r\n\r\n\r\n\r\n\r\n### Reproduction\r\n\r\nyarn add vitepress\r\n\r\nedit package.json\r\n\r\n~~~\r\n \"scripts\": {\r\n \"docs:dev\": \"vitepress dev docs\",\r\n \"docs:build\": \"vitepress build docs\",\r\n \"docs:serve\": \"vitepress serve docs\"\r\n }\r\n~~~\r\n\r\nyarn docs:dev\r\n\r\n### Expected behavior\r\n\r\nnormal display\r\n\r\n### System Info\r\n\r\n```shell\r\nSystem:\r\n OS: Windows 10 10.0.17763\r\n CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz\r\n Memory: 3.25 GB / 7.93 GB\r\n Binaries:\r\n Node: 16.5.0 - C:\\Program Files\\nodejs\\node.EXE\r\n Yarn: 1.22.10 - ~\\AppData\\Roaming\\npm\\yarn.CMD\r\n npm: 7.20.5 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Chrome: 92.0.4515.107\r\n Edge: Spartan (44.17763.831.0)\r\n Internet Explorer: 11.0.17763.771\r\n npmPackages:\r\n vitepress: ^0.16.1 => 0.16.1\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/coc)\r\n- [X] Read the [docs](https://vitepress.vuejs.org/).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2912],{"name":2866,"color":2867},362,"Strange symbols appear","2023-01-21T16:22:12Z","https://github.com/vuejs/vitepress/issues/362",0.70523345,{"description":2919,"labels":2920,"number":2922,"owner":2872,"repository":2873,"state":2884,"title":2923,"updated_at":2924,"url":2925,"score":2926},"### Describe the bug\n\n\r\n\r\n打包报错css问题,css没有任何问题,theme里全局引入组件库的,版本\"vitepress\": \"1.0.0-beta.1\"\n\n### Reproduction\n\nv \"vitepress\": \"1.0.0-beta.1\"\n\n### Expected behavior\n\n正常打包\n\n### System Info\n\n```sh\nnpm run build\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2921],{"name":2866,"color":2867},2439,"打包报错Unexpected token '.' 问题","2023-06-08T00:04:08Z","https://github.com/vuejs/vitepress/issues/2439",0.70708805,{"description":2928,"labels":2929,"number":2931,"owner":2872,"repository":2873,"state":2884,"title":2932,"updated_at":2933,"url":2934,"score":2935},"### Describe the bug\r\n\r\nWhen the Vite extension checks if the server is up, it resolves `localhost` to `127.0.0.1`, which will result in `ECONNREFUSED` as the server is no longer running on `127.0.0.1`.\r\n\r\nRelated commit: [`7787bbe` (#856)](https://github.com/vuejs/vitepress/pull/856/commits/7787bbe59a088f45025457587930308c25c84d27), \r\n\r\nRelated code for extension: https://github.com/antfu/vscode-vite/blob/main/src/utils.ts#L31\r\n\r\n### Reproduction\r\n\r\nI am unable to provide a reproduction as this occurs on VSCode. However, any VitePress project after alpha 5 can reproduce this issue. It may be a Linux only issue\r\n\r\n### Expected behavior\r\n\r\nI'm not very sure what the right behavior would be. Since a new Vite project runs the server on `127.0.0.1` by default, VitePress could also follow the same behavior.\r\n\r\n### System Info\r\n\r\n```shell\r\nSystem:\r\n OS: Linux 5.18 Pop!_OS 22.04 LTS\r\n CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz\r\n Memory: 21.03 GB / 31.22 GB\r\n Container: Yes\r\n Shell: 5.1.16 - /bin/bash\r\n Binaries:\r\n Node: 16.15.1 - ~/.volta/tools/image/node/16.15.1/bin/node\r\n Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn\r\n npm: 8.11.0 - ~/.volta/tools/image/node/16.15.1/bin/npm\r\n Browsers:\r\n Firefox: 103.0\r\n npmPackages:\r\n vitepress: 1.0.0-alpha.6 => 1.0.0-alpha.6\r\n```\r\n\r\n\r\n### Additional context\r\n\r\nTemporary workaround is to start VitePress with `--host`\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.vuejs.org).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2930],{"name":2869,"color":2870},1203,"`verbatim` DNS result order breaks VSCode Vite extension","2023-08-11T00:04:24Z","https://github.com/vuejs/vitepress/issues/1203",0.7087009,{"description":2937,"labels":2938,"number":2942,"owner":2872,"repository":2873,"state":2884,"title":2943,"updated_at":2944,"url":2945,"score":2946},"### Describe the bug\r\n\r\nMainly described in the title, further description is at 4th point of reproducing the error. This is reproduced in normal python http server, and seems to happen in github pages as well.\r\n\r\nMight be related to #412, but I don't think its exactly the same behavior & cause.\r\n\r\n### Reproduction\r\n\r\n1. Download the repro and unzip, it should have the following content:\r\n\r\n```bash\r\n.\r\n├── content\r\n│ ├── first\r\n│ │ ├── index.md\r\n│ │ └── second.md\r\n│ └── index.md\r\n├── package.json\r\n└── yarn.lock\r\n```\r\n\r\n[vitepress-repro.zip](https://github.com/vuejs/vitepress/files/9575259/vitepress-repro.zip)\r\n\r\n\r\n2. Run `yarn && yarn run content:build`\r\n a `site` folder at project root should be created.\r\n4. Run `python3 -m http.server -d . 4000`, and lookup `localhost:4000/site`.\r\n Everything looks fine, you can navigate to First using navbar, and second.md file in first by left panel.\r\n5. Now refresh at the same `localhost:4000/site/first/second`.\r\n You should see the page is loaded but a 404 page is added at the bottom too, now if you try to navigate, the top of page remains as is, the bottom of page is instead replaced by the new content.\r\n\r\n### Expected behavior\r\n\r\nPage should not append a 404 page, nor it should load navigated pages in bottom of page instead of replacing current page.\r\n\r\n### System Info\r\n\r\n```shell\r\nSystem:\r\n OS: Linux 5.18 Void\r\n CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz\r\n Memory: 3.97 GB / 7.56 GB\r\n Container: Yes\r\n Shell: 3.5.1 - /usr/bin/fish\r\n Binaries:\r\n Node: 16.15.1 - /usr/bin/node\r\n Yarn: 1.22.18 - /usr/bin/yarn\r\n npm: 8.11.0 - /usr/bin/npm\r\n```\r\n\r\n\r\n### Additional context\r\n\r\nFull page screenshot\r\n\r\n\r\n\r\nTwo errors, in order appears in the browser's console:\r\n\r\n```\r\nFailed to load resource: the server responded with a status of 404 (File not found) :4000/site/assets/first_second_index.md.undefined.lean.js:1\r\n\r\nHydration completed but contains mismatches. app.558d10a0.js:1\r\n```\r\n\r\nPoint to be noted is that `first_second_index.md.undefined.lean.js` is trying to get fetched, i.e. the \"undefined\" hash.\r\n\r\n### Validations\r\n\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.vuejs.org).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2939],{"name":2940,"color":2941},"need more info","bdbefc",1345,"Built content when served manually (not `vitepress dev \u003Csrc>`) adds a 404 page at end of page, and later navigation loads the page there at bottom replacing 404 at the bottom.","2023-01-21T14:25:22Z","https://github.com/vuejs/vitepress/issues/1345",0.7089115,{"description":2948,"labels":2949,"number":2953,"owner":2872,"repository":2873,"state":2884,"title":2954,"updated_at":2955,"url":2956,"score":2957},"### Describe the bug\n\n使用官方文档的部署脚本成功部署到Github Pages之后,此时如果配置使用自定义域名的话,访问时样式会丢失\n\n### Reproduction\n\n1. 博客目录结构如下所示:\u003Cbr />\r\n2. 配置文件如下所示:\u003Cbr /> \n\n### Expected behavior\n\n使用 Github 自带的 https://xihuanxiaorang.github.io/docs/ 访问就没有任何问题,如果是使用自定义域名 https://docs.xiaorang.fun/ 的话,样式就会丢失\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 10 10.0.19045\r\n CPU: (4) x64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz\r\n Memory: 659.73 MB / 3.92 GB\r\n Binaries:\r\n Node: 20.11.0 - E:\\nodejs\\node.EXE\r\n Yarn: 1.22.21 - E:\\nodejs\\node_global\\yarn.CMD\r\n npm: 10.2.4 - E:\\nodejs\\npm.CMD\r\n pnpm: 8.14.3 - E:\\nodejs\\node_global\\pnpm.CMD\r\n Browsers:\r\n Edge: Chromium (120.0.2210.144)\r\n Internet Explorer: 11.0.19041.3636\r\n npmPackages:\r\n vitepress: 1.0.0-rc.40 => 1.0.0-rc.40\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2950],{"name":2951,"color":2952},"question","5D5FAE",3513,"部署到Github Pages之后,如果使用自定义域名的话样式会丢失","2024-02-07T00:04:15Z","https://github.com/vuejs/vitepress/issues/3513",0.7091179,{"description":2959,"labels":2960,"number":2964,"owner":2872,"repository":2873,"state":2884,"title":2965,"updated_at":2966,"url":2967,"score":2968},"### Describe the bug\n\n\r\n\r\nI use the config file out of .vitepress, I just import it in `.vitepress/config.ts`\r\n\r\nwhen I modify `.vitepress/config.ts`, hot reload works well, but I modify the outer config.ts, hot reloading does not work.\r\n\n\n### Reproduction\n\nJust modify the outer config.ts, the page does not get update.\n\n### Expected behavior\n\nI think vitepress should track the import modules graph in .vitepress/config.ts, and hot reload all of them.\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 12.0.1\r\n CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz\r\n Memory: 668.14 MB / 16.00 GB\r\n Shell: 5.8 - /bin/zsh\r\n Binaries:\r\n Node: 16.14.1 - ~/.volta/tools/image/node/16.14.1/bin/node\r\n Yarn: 1.22.15 - ~/.yarn/bin/yarn\r\n npm: 7.10.0 - ~/.volta/tools/image/npm/7.10.0/bin/npm\r\n Browsers:\r\n Chrome: 99.0.4844.74\r\n Edge: 98.0.1108.55\r\n Firefox: 95.0.2\r\n Safari: 15.1\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2961],{"name":2962,"color":2963},"build","377ba8",581,"When modifying config.ts imported outside of .vitepress folder, it is not hot reload","2023-01-21T14:28:57Z","https://github.com/vuejs/vitepress/issues/581",0.70980686,["Reactive",2970],{},["Set"],["ShallowReactive",2973],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fpzQM6Vc-hDuhohEvAfp7QbVjrIly-XHXAKQpu3eh1fU":-1},"/vuejs/vitepress/3382"]