\n\n\u003Cimg width=\"821\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/d4b60aea-4b7c-422f-8c0e-339be12dbe42\" />\n\n\u003Cimg width=\"901\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/691bb9b3-a61d-4f15-8426-68416f7340da\" />\n\n\u003Cimg width=\"915\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/9c8470cc-7c45-476a-aaf1-3f990a1c57f0\" />\n\n### System Info\n\n```Text\nSystem:\n OS: Windows 11 10.0.22631\n CPU: (28) x64 Intel(R) Core(TM) i7-14700KF\n Memory: 15.99 GB / 31.82 GB\n Binaries:\n Node: 20.17.0 - D:\\Program Files\\nodejs\\node.EXE\n npm: 10.8.2 - D:\\Program Files\\nodejs\\npm.CMD\n pnpm: 9.8.0 - D:\\Program Files\\nodejs\\pnpm.CMD\n Browsers:\n Edge: Chromium (127.0.2651.74)\n Internet Explorer: 11.0.22621.3527\n npmPackages:\n vitepress: ^1.6.3 => 1.6.3\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.",[2912],{"name":2868,"color":2869},4519,"\"vitepress\" work with \"unplugin-vue-components\" bug","2025-02-02T04:41:47Z","https://github.com/vuejs/vitepress/issues/4519",0.6839623,{"description":2919,"labels":2920,"number":2921,"owner":2874,"repository":2875,"state":2886,"title":2922,"updated_at":2923,"url":2924,"score":2925},"### Is your feature request related to a problem? Please describe.\r\n\r\nIssue 1: Is there a way or how to get the `md` instance (per-configured by VitePress) in Vue component\r\n- I know it might be impossible or being problematic because it's supposed to be run at build-time which is in Node.js, so I'm not expecting a yes answer here, but is there any better alternative way to do so?\r\n- Note due to some reason, I don't really want to write markdown straight away, instead I want to leverage the power of yaml format, and handle the transformation just once. (Since I don't want my team to ask me how to write certain md syntax with my custom component again and again, since `Vue in markdown` is not that straight forward for them). And defining API schemas by `yaml` makes more sense to me instead of writing markdown to document.\r\n\r\nIssue 2: I noticed that by my current implementation (see below), those data are not collected by `local (minisearch)` search. This might be because data collection is happening at build-time (not sure)? Is there any way to work around this?\r\n\r\n---\r\nMy use-case:\r\n\r\nImagine a custom layout here:\r\n```md\r\n---\r\nlayout: api # my custom layout\r\nrequests:\r\n - url: /getSecurityType\r\n method: post\r\n # ....\r\n\r\n - url: /getSecurityCategory\r\n method: post\r\n # ....\r\n---\r\n```\r\nFor example, I want to map the URL to `\u003Ch2>`, and also benefit from built-in VitePress features such as `aside`.\r\n\r\nBut I found out that normal h2 won't work, since `aside` is collecting only `h2` with children, which is the `#` link on the left by default. This makes sense, but it's a little bit hard for me to manually copy the dom.\r\n\r\nA comparison could be like:\r\nWhat I want:\r\n```vue\r\n\u003Cscript setup lang=\"ts\">\r\nimport { useData } from 'vitepress';\r\nimport { md } from '???'; // This is what I want\r\nimport type { ApiFrontMatter } from '@theme/types/api';\r\nimport type { VitePressData } from 'vitepress';\r\nimport type { Ref } from 'vue';\r\n\r\nconst { frontmatter: fm } = useData() as VitePressData & { frontmatter: Ref\u003CApiFrontMatter> };\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003Cdiv class=\"vp-doc\">\r\n \u003Ch1>{{ fm.setName }}\u003C/h1>\r\n\r\n \u003Ctemplate v-for=\"req in fm.requests\" :key=\"req.url\">\r\n \u003C!-- md instance imported from somewhere (that's what I want) -->\r\n {{ md.render(`## ${req.url}`) }}\r\n \u003C/template>\r\n \u003C/div>\r\n\u003C/template>\r\n```\r\nCurrently, I have to mimic it (although it works for styles and aside, but search data collection ignores them):\r\n```vue\r\n\u003Cscript setup lang=\"ts\">\r\nimport { useData } from 'vitepress';\r\nimport type { ApiFrontMatter } from '@theme/types/api';\r\nimport type { VitePressData } from 'vitepress';\r\nimport type { Ref } from 'vue';\r\n\r\nconst { frontmatter: fm } = useData() as VitePressData & { frontmatter: Ref\u003CApiFrontMatter> };\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003Cdiv class=\"vp-doc\">\r\n \u003Ch1>{{ fm.setName }}\u003C/h1>\r\n\r\n \u003Ctemplate v-for=\"req in fm.requests\" :key=\"req.url\">\r\n \u003Ch2 :id=\"req.url\">\r\n {{ req.url }}\r\n \u003Ca\r\n class=\"header-anchor\"\r\n :href=\"`#${req.url}`\"\r\n :aria-label=\"`Permalink to "${req.url}"`\"\r\n >\r\n ​\r\n \u003C/a>\r\n \u003C/h2>\r\n \u003C/template>\r\n \u003C/div>\r\n\u003C/template>\r\n```\r\n\r\n### Describe alternatives you've considered\r\n\r\nThe worst case is I need to write a custom `markdown-it` plugin and wrap all those yaml into a custom block and do the transformation there... But honestly that's gonna be a huge pain...\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.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],2605,"How to get the `md` instance (include all plugins defined) to parse my custom string in Vue component?","2023-08-15T00:04:17Z","https://github.com/vuejs/vitepress/issues/2605",0.68716055,{"description":2927,"labels":2928,"number":2930,"owner":2874,"repository":2875,"state":2886,"title":2931,"updated_at":2932,"url":2933,"score":2934},"### Describe the bug\r\n\r\nIt show error when I run `pnpm build`\r\n\r\n### Reproduction\r\n\r\n- vite config:\r\n```\r\nvite: {\r\n server: {\r\n // target: 'webworker',\r\n host: true,\r\n port: 3001,\r\n fs: {\r\n // for when developing with locally linked theme\r\n allow: ['../..']\r\n }\r\n },\r\n build: {\r\n // minify: 'terser',\r\n chunkSizeWarningLimit: Infinity\r\n },\r\n json: {\r\n stringify: true\r\n },\r\n ssr: {\r\n format: 'cjs',\r\n noExternal: []\r\n },\r\n legacy: {\r\n buildSsrCjsExternalHeuristics: true\r\n },\r\n plugins: [\r\n vueJsx(),\r\n SearchPlugin({\r\n tokenize: 'full'\r\n })\r\n ],\r\n css: {\r\n preprocessorOptions: {\r\n less: {\r\n javascriptEnabled: true\r\n }\r\n }\r\n }\r\n },\r\n\r\n vue: {\r\n reactivityTransform: true\r\n }\r\n```\r\n\r\n\r\n- build error:\r\n\r\n```\r\nbuild error:\r\n /Users/bou/working/code/practice/sinogear-frontend-component-vue/docs/node_modules/.pnpm/ant-design-vue@3.2.15_vue@3.2.45/node_modules/ant-design-vue/es/locale/zh_CN.js:2\r\nimport Pagination from '../vc-pagination/locale/zh_CN';\r\n^^^^^^\r\n\r\nSyntaxError: Cannot use import statement outside a module\r\n```\r\n\r\n### Expected behavior\r\n\r\nbuild successful\r\n\r\n### System Info\r\n\r\n```shell\r\n\"ant-design-vue\": \"^3.2.10\",\r\n \"@vue/theme\": \"^1.2.2\",\r\n \"vue\": \"^3.2.37\",\r\n \"vitepress\": \"^1.0.0-alpha.31\",\r\n \"vitepress-plugin-search\": \"1.0.4-alpha.15\",\r\n \"vitepress-theme-demoblock\": \"^2.0.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] 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.",[2929],{"name":2868,"color":2869},1695,"Build Error: Cannot use import statement outside a module","2023-01-21T14:16:57Z","https://github.com/vuejs/vitepress/issues/1695",0.6910075,{"description":2936,"labels":2937,"number":2939,"owner":2874,"repository":2875,"state":2886,"title":2940,"updated_at":2941,"url":2942,"score":2943},"### Describe the bug\r\n\r\nI got the following when I upgrade to the lastest alpha73:\r\n```\r\nSyntaxError: Cannot use import statement outside a module\r\n```\r\n\r\nThen I try to create new fresh project following the document and get the same.\r\n\r\nWhat's wrong?\r\n\r\n### Reproduction\r\n\r\n```\r\nPS W:\\work\\2023\\test> yarn add -D vitepress\r\n```\r\nyarn add v1.22.19\r\ninfo No lockfile found.\r\n[1/4] Resolving packages...\r\nwarning vitepress > vue > @vue/compiler-sfc > magic-string > sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead\r\n[2/4] Fetching packages...\r\n[3/4] Linking dependencies...\r\nwarning \"vitepress > @docsearch/js > @docsearch/react > @algolia/autocomplete-preset-algolia@1.7.4\" has unmet peer dependency \"@algolia/client-search@>= 4.9.1 \u003C 6\".\r\n[4/4] Building fresh packages...\r\nsuccess Saved lockfile.\r\nsuccess Saved 47 new dependencies.\r\ninfo Direct dependencies\r\n└─ vitepress@1.0.0-alpha.73\r\ninfo All dependencies\r\n├─ @algolia/autocomplete-core@1.7.4\r\n├─ @algolia/autocomplete-preset-algolia@1.7.4\r\n├─ @algolia/cache-browser-local-storage@4.17.0\r\n├─ @algolia/cache-in-memory@4.17.0\r\n├─ @algolia/client-account@4.17.0\r\n├─ @algolia/client-analytics@4.17.0\r\n├─ @algolia/client-personalization@4.17.0\r\n├─ @algolia/logger-console@4.17.0\r\n├─ @algolia/requester-browser-xhr@4.17.0\r\n├─ @algolia/requester-node-http@4.17.0\r\n├─ @docsearch/css@3.3.3\r\n├─ @docsearch/js@3.3.3\r\n├─ @docsearch/react@3.3.3\r\n├─ @esbuild/win32-x64@0.17.18\r\n├─ @types/web-bluetooth@0.0.16\r\n├─ @vitejs/plugin-vue@4.1.0\r\n├─ @vue/compiler-sfc@3.2.47\r\n├─ @vue/devtools-api@6.5.0\r\n├─ @vue/reactivity-transform@3.2.47\r\n├─ @vue/reactivity@3.2.47\r\n├─ @vue/runtime-core@3.2.47\r\n├─ @vue/runtime-dom@3.2.47\r\n├─ @vue/server-renderer@3.2.47\r\n├─ @vueuse/core@10.1.0\r\n├─ @vueuse/metadata@10.1.0\r\n├─ @vueuse/shared@10.1.0\r\n├─ algoliasearch@4.17.0\r\n├─ ansi-sequence-parser@1.1.0\r\n├─ body-scroll-lock@4.0.0-beta.0\r\n├─ csstype@2.6.21\r\n├─ esbuild@0.17.18\r\n├─ jsonc-parser@3.2.0\r\n├─ mark.js@8.11.1\r\n├─ minisearch@6.0.1\r\n├─ nanoid@3.3.6\r\n├─ picocolors@1.0.0\r\n├─ postcss@8.4.23\r\n├─ preact@10.13.2\r\n├─ rollup@3.21.0\r\n├─ shiki@0.14.1\r\n├─ source-map-js@1.0.2\r\n├─ sourcemap-codec@1.4.8\r\n├─ vite@4.3.1\r\n├─ vitepress@1.0.0-alpha.73\r\n├─ vscode-oniguruma@1.7.0\r\n├─ vscode-textmate@8.0.0\r\n└─ vue@3.2.47\r\nDone in 6.98s.\r\n```\r\nPS W:\\work\\2023\\test> npx vitepress init \r\n```\r\n\r\n vitepress v1.0.0-alpha.73\r\n\r\n┌ Welcome to VitePress! \r\n│\r\n◇ Where should VitePress initialize the config?\r\n│ ./docs/\r\n│\r\n◇ Site title:\r\n│ My Awesome Project\r\n│\r\n◇ Site description:\r\n│ A VitePress Site\r\n│\r\n◇ Theme:\r\n│ Default Theme\r\n│\r\n◇ Use TypeScript for config and theme files?\r\n│ Yes\r\n│\r\n◇ Add VitePress npm scripts to package.json?\r\n│ Yes\r\n│\r\n└ Done! Now run npm run docs:dev and start writing.\r\n\r\n```\r\nPS W:\\work\\2023\\test> yarn docs:dev\r\n```\r\n\r\nyarn run v1.22.19\r\nwarning package.json: No license field\r\n$ vitepress dev docs/\r\nfailed to load config from W:\\work\\2023\\test\\docs\\.vitepress\\config.ts\r\nfailed to start server. error:\r\nW:\\work\\2023\\test\\docs\\.vitepress\\config.ts:1\r\nimport { defineConfig } from 'vitepress'\r\n^^^^^^\r\n\r\n**SyntaxError: Cannot use import statement outside a module**\r\n at Object.compileFunction (node:vm:360:18)\r\n at wrapSafe (node:internal/modules/cjs/loader:1055:15)\r\n at Module._compile (node:internal/modules/cjs/loader:1090:27)\r\n at Module._extensions..js (node:internal/modules/cjs/loader:1180:10)\r\n at Object._require.extensions.\u003Ccomputed> [as .js] (file:///W:/work/2023/test/node_modules/vite/dist/node/chunks/dep-24daf00c.js:64459:17)\r\n at Module.load (node:internal/modules/cjs/loader:1004:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:839:12)\r\n at Module.require (node:internal/modules/cjs/loader:1028:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at loadConfigFromBundledFile (file:///W:/work/2023/test/node_modules/vite/dist/node/chunks/dep-24daf00c.js:64464:21)\r\nerror Command failed with exit code 1.\r\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\r\n```\r\nPS W:\\work\\2023\\test> \r\n```\r\n\r\n### Expected behavior\r\n\r\nIt should be work fine if following the documents.\r\n\r\n### System Info\r\n\r\n```shell\r\nPS W:\\work\\2023\\test> npx envinfo --system --npmPackages vitepress --binaries --browsers\r\n```\r\nNeed to install the following packages:\r\n envinfo@7.8.1\r\nOk to proceed? (y) y\r\n\r\n System:\r\n OS: Windows 10 10.0.22621\r\n CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz\r\n Memory: 49.02 GB / 63.73 GB\r\n Binaries:\r\n Node: 16.17.1 - C:\\Program Files\\nodejs\\node.EXE\r\n Yarn: 1.22.19 - ~\\AppData\\Roaming\\npm\\yarn.CMD\r\n npm: 8.15.0 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22621.1555.0), Chromium (112.0.1722.58), ChromiumDev (114.0.1793.0)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.73 => 1.0.0-alpha.73\r\n\r\n\r\n\r\n### Additional context\r\n\r\nNone\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.dev).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2938],{"name":2868,"color":2869},2280,"Alpha73 Get the error: Cannot use import statement outside a module","2023-05-03T00:03:49Z","https://github.com/vuejs/vitepress/issues/2280",0.69170576,{"description":2945,"labels":2946,"number":2947,"owner":2874,"repository":2875,"state":2886,"title":2948,"updated_at":2949,"url":2950,"score":2951},"### Describe the bug\n\nThe MD content contains the following code build error\r\n\r\n```md\r\n## Properties\r\n\r\n| Property | Type |\r\n| -------- | ------------------------------------ |\r\n| icon | { active: string; default: string; } |\r\n```\r\n\r\n```plain\r\nyarn run v1.22.11\r\n$ vitepress build docs\r\nvitepress v0.20.0\r\n⠋ building client + server bundles...[vite:vue] Duplicate attribute.\r\nfile: /vitepress-bug-demo/docs/index.md:5:42\r\n✖ building client + server bundles...\r\n[vite:vue] Cannot read property 'line' of undefined\r\nfile: /vitepress-bug-demo/docs/index.md\r\nbuild error:\r\n SyntaxError: Duplicate attribute.\r\n at createCompilerError (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:19:19)\r\n at emitError (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1599:29)\r\n at parseAttribute (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1340:9)\r\n at parseAttributes (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1316:22)\r\n at parseTag (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1186:17)\r\n at parseElement (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1115:21)\r\n at parseChildren (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:943:28)\r\n at parseElement (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1131:22)\r\n at parseChildren (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:943:28)\r\n at parseElement (/vitepress-bug-demo/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1131:22) {\r\n code: 'PLUGIN_ERROR',\r\n loc: {\r\n file: '/vitepress-bug-demo/docs/index.md',\r\n line: 5,\r\n column: 42\r\n },\r\n id: '/vitepress-bug-demo/docs/index.md',\r\n plugin: 'vue',\r\n hook: 'transform',\r\n pluginCode: 2,\r\n watchFiles: [\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/app/index.js',\r\n '/vitepress-bug-demo/docs/index.md',\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/app/utils.js',\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/app/router.js',\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/app/data.js',\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/app/composables/head.js',\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/app/composables/preFetch.js',\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/app/components/Content.js',\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/app/components/ClientOnly.js',\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/app/components/Debug.vue',\r\n '/vitepress-bug-demo/node_modules/vue/dist/vue.runtime.esm-bundler.js',\r\n '/vitepress-bug-demo/node_modules/vitepress/dist/client/theme-default/index.js'\r\n ]\r\n}\r\n```\n\n### Reproduction\n\nhttps://github.com/keuby/vitepress-bug-demo.git\n\n### Expected behavior\n\nBuild does not report errors\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 11.6\r\n CPU: (8) arm64 Apple M1\r\n Memory: 121.91 MB / 16.00 GB\r\n Shell: 5.8 - /bin/zsh\r\n Binaries:\r\n Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node\r\n Yarn: 1.22.11 - ~/.nvm/versions/node/v14.17.6/bin/yarn\r\n npm: 6.14.15 - ~/.nvm/versions/node/v14.17.6/bin/npm\r\n Browsers:\r\n Chrome: 96.0.4664.55\r\n Edge: 95.0.1020.53\r\n Firefox: 90.0\r\n Safari: 15.0\r\n npmPackages:\r\n vitepress: ^0.20.0 => 0.20.0 \r\n```\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/coc)\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.",[],449,"Compilation errors occur in some special cases","2023-01-21T14:35:49Z","https://github.com/vuejs/vitepress/issues/449",0.69447136,{"description":2953,"labels":2954,"number":2958,"owner":2874,"repository":2875,"state":2886,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### Vue version\n\n3.2.45\n\n### Link to minimal reproduction\n\nhttps://github.com/newstart0514/vueProblem\n\n### Steps to reproduce\n\nUse vitepress to set the file route normally. The file is routed to the md file (needs to be imported to the local). This error occurs when opening the route\n\n### What is expected?\n\nThe md file will be converted to html normally\n\n### What is actually happening?\n\nAn error occurred and rendering cannot be performed normally. The error message is: Unhandled error during execution of scheduler flush This is likely a Vue internals bug.\n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.22000\r\n CPU: (16) x64 AMD Ryzen 7 4800U with Radeon Graphics\r\n Memory: 4.01 GB / 15.37 GB\r\n Binaries:\r\n Node: 18.12.1 - D:\\nodejs\\node.EXE\r\n Yarn: 1.22.18 - ~\\AppData\\Roaming\\npm\\yarn.CMD\r\n npm: 8.19.2 - D:\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22000.120.0), Chromium (110.0.1587.63)\r\n Internet Explorer: 11.0.22000.120\r\n npmPackages:\r\n vue: ^3.2.45 => 3.2.45\n```\n\n\n### Any additional comments?\n\n_No response_",[2955],{"name":2956,"color":2957},"need more info","bdbefc",2046,"An error occurred when rendering a markdown file when using vitepress","2023-06-01T00:04:29Z","https://github.com/vuejs/vitepress/issues/2046",0.69460934,["Reactive",2964],{},["Set"],["ShallowReactive",2967],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fkHxpfKTPkcMWNb3fCYd4b1kKljqvQT49lhH5Mzu5Sv8":-1},"/vuejs/vitepress/922"]