\r\n title: Feature A\r\n details: Lorem ipsum dolor sit amet, consectetur adipiscing elit\r\n```\r\n\r\nCheck the feature icon type\r\n```ts\r\ntype FeatureIcon =\r\n | string\r\n | { src: string; alt?: string; width?: string; height: string }\r\n | {\r\n light: string\r\n dark: string\r\n alt?: string\r\n width?: string\r\n height: string\r\n }\r\n```\r\n\r\nI refer to the render logic, use `v-html` render the icon.\r\nDisplay well in `dev` environment, but shows errors in `prod` environment.\r\n\r\n| dev | build |\r\n| ----------- | ----------- |\r\n|  |  |\r\n\r\n\r\n\r\n\r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/github/zyyv/vitepress-unocss-issue\r\n\r\n- Display right run `pnpm dev`\r\n- Display error run `pnpm build && pnpm preview`\r\n\r\n### Expected behavior\r\n\r\nDev and build behave the same\r\n\r\n### System Info\r\n\r\n```Text\r\nlatest\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.",[2867,2870,2873],{"name":2868,"color":2869},"build","377ba8",{"name":2871,"color":2872},"has-workaround","1B4515",{"name":2874,"color":2875},"stale","ededed",4045,"vuejs","vitepress","open","SSR in dev for more consistent output in dev and prod","2025-03-02T18:08:58Z","https://github.com/vuejs/vitepress/issues/4045",0.6881786,{"description":2885,"labels":2886,"number":2890,"owner":2877,"repository":2878,"state":2891,"title":2892,"updated_at":2893,"url":2894,"score":2895},"### Describe the bug\n\nI do not want use ssr method build document. by the way, Whether the current version supports building a single page?\n\n### Reproduction\n\nI do not want use ssr method build document. by the way, Whether the current version supports building a single page?\n\n### Expected behavior\n\nI do not want use ssr method build document. by the way, Whether the current version supports building a single page?\n\n### System Info\n\n```sh\nI do not want use ssr method build document. by the way, Whether the current version supports building a single page?\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.",[2887],{"name":2888,"color":2889},"bug: pending triage","e99695",2841,"closed","How to build with csr ","2023-09-01T00:04:34Z","https://github.com/vuejs/vitepress/issues/2841",0.6470133,{"description":2897,"labels":2898,"number":2902,"owner":2877,"repository":2878,"state":2891,"title":2903,"updated_at":2904,"url":2905,"score":2906},"### Describe the bug\n\n很多时候在 `vitepress` 中难免使用到 `document`,但是 `vitepress` 使用服务端渲染方式,如何避免其打包的错误呢?\r\n\r\n有什么第三方插件推荐或者配置项吗?\r\n\r\n\u003Chr />\r\n\r\nIt is inevitable to use `document` in `vitepress` many times, but how to avoid the packaging error when` vitepress` uses the server-side rendering method?\r\n\r\nAre there any third-party plug-in recommendations or configuration items?\n\n### Reproduction\n\n```vue\r\n\u003Cscript setup>\r\n console.log(document)\r\n\u003C/script>\r\n```\r\n\r\n\r\n\n\n### Expected behavior\n\nBuild ok\n\n### System Info\n\n```shell\n\"vitepress\": \"^1.0.0-alpha.4\",\r\n\"vue\": \"^3.2.33\"\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.",[2899],{"name":2900,"color":2901},"question","5D5FAE",1120,"document is not defined","2023-01-21T14:28:51Z","https://github.com/vuejs/vitepress/issues/1120",0.652712,{"description":2908,"labels":2909,"number":2911,"owner":2877,"repository":2878,"state":2891,"title":2912,"updated_at":2913,"url":2914,"score":2915},"### Is your feature request related to a problem? Please describe.\n\nNope.\n\n### Describe the solution you'd like\n\nProvide a config option, like `lastUpdated`.\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\nNot very familiar with Node and Vite. I tried to do it on my own, but failed with 'process is not defined'. Any help?\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2910],{"name":2900,"color":2901},3001,"Support to show page contributors","2023-10-01T00:04:52Z","https://github.com/vuejs/vitepress/issues/3001",0.662829,{"description":2917,"labels":2918,"number":2920,"owner":2877,"repository":2878,"state":2891,"title":2921,"updated_at":2922,"url":2923,"score":2924},"### Describe the bug\n\nI imported a lib which called document APIs. The minimized reproduction:\r\n\r\n```\r\n\u003Cscript>\r\nconst div = document.createElement('div');\r\nconsole.log(div)\r\n\u003C/script>\r\n\r\n# Hello World\r\n```\r\n\r\nIt works in vitepress dev but fails in vitepress build\n\n### Reproduction\n\nhttps://github.com/Jinjiang/reproductions/tree/vitepress-document-20240219\n\n### Expected behavior\n\nWorks as vitepress dev does\n\n### System Info\n\n```Text\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: 75.17 MB / 8.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.1.0 - ~/.asdf/installs/nodejs/20.1.0/bin/node\r\n Yarn: 1.22.19 - ~/.asdf/shims/yarn\r\n npm: 9.6.4 - ~/.asdf/plugins/nodejs/shims/npm\r\n Browsers:\r\n Safari: 17.4\r\n npmPackages:\r\n vitepress: 1.0.0-rc.43 => 1.0.0-rc.43\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.",[2919],{"name":2888,"color":2889},3583,"document is not defined when vitepress build","2024-02-27T00:05:55Z","https://github.com/vuejs/vitepress/issues/3583",0.66396385,{"description":2926,"labels":2927,"number":2928,"owner":2877,"repository":2878,"state":2891,"title":2929,"updated_at":2930,"url":2931,"score":2932},"### Is your feature request related to a problem? Please describe.\n\n当我在文档里插入图片发布后,图片中有部分内容在页面上较为模糊。我试过markdown-it-custom-attrs插件,但是好像没有生效。\n\n### Describe the solution you'd like\n\n在vitepress中集成图片灯箱的功能,或者有什么办法可以集成相关组件(希望给一个示例)\n\n### Describe alternatives you've considered\n\n_No response_\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.dev).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],2674,"能否增加一个图片点击放大的功能。","2023-08-01T00:04:35Z","https://github.com/vuejs/vitepress/issues/2674",0.6700005,{"description":2934,"labels":2935,"number":2937,"owner":2877,"repository":2878,"state":2891,"title":2938,"updated_at":2939,"url":2940,"score":2941},"### Describe the bug\n\nI am writing the package of `controllable-animate` and preparing write doc for this package \r\n\r\nwhen I run npm run docs:dev it works just fine\r\nbut when I run npm run docs:build it failed\r\nand shows an error message:\r\n```sh\r\n✓ building client + server bundles...\r\nbuild error:\r\n ReferenceError: document is not defined\r\n at file:///Users/songwufan/Desktop/newPro/controllable-animate/docs/main/.vitepress/.temp/app.js:4380:3\r\n at ModuleJob.run (internal/modules/esm/module_job.js:183:25)\r\n at async Loader.import (internal/modules/esm/loader.js:178:24)\r\n at async build (file:///Users/songwufan/Desktop/newPro/controllable-animate/node_modules/.pnpm/vitepress@1.0.0-alpha.29_tbpndr44ulefs3hehwpi2mkf2y/node_modules/vitepress/dist/node/serve-fcdc8868.js:42002:24)\r\n```\r\nreproduce steps: \r\nFirst: I try to use `docuement` in vue directive like this: \r\n```ts\r\nif (typeof window !== undefined) {\r\n root = document.documentElement || document.body\r\n}\r\n```\r\nSecond: I use this package in my code :main/.vitepress/theme/index.ts\r\n```ts\r\nimport {\r\n vcontrollableanimate,\r\n} from 'controllable-animate'\r\nexport default {\r\n ...DefaultTheme,\r\n enhanceApp({ app }) {\r\n // app.Plugin\r\n app.directive('controllable-animate', vcontrollableanimate)\r\n },\r\n}\r\n```\n\n### Reproduction\n\nnone\n\n### Expected behavior\n\nIt should work in dev and build mode.\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 12.6\r\n CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz\r\n Memory: 103.34 MB / 8.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 14.19.0 - ~/.nvm/versions/node/v14.19.0/bin/node\r\n Yarn: 1.22.17 - /usr/local/bin/yarn\r\n npm: 6.14.16 - ~/.nvm/versions/node/v14.19.0/bin/npm\r\n Watchman: 4.9.0 - /usr/local/bin/watchman\r\n Browsers:\r\n Chrome: 107.0.5304.110\r\n Chrome Canary: 110.0.5434.0\r\n Firefox: 97.0.2\r\n Firefox Developer Edition: 106.0\r\n Safari: 15.6.1\r\n npmPackages:\r\n vitepress: 1.0.0-alpha.29 => 1.0.0-alpha.29\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.",[2936],{"name":2888,"color":2889},1638,"Can't build vitepress when I use npm package","2023-01-21T14:20:37Z","https://github.com/vuejs/vitepress/issues/1638",0.6780802,{"description":2943,"labels":2944,"number":666,"owner":2877,"repository":2878,"state":2891,"title":2945,"updated_at":2946,"url":2947,"score":2948},"## Description\r\nOn a Vue 3 beta 12 + VitePress 0.1.1 project, trying to build with `vitepress build` crashes with the following error\r\n\r\n## Output\r\n```\r\n$ vitepress build\r\nvitepress v0.1.1\r\nbuilding client bundle...\r\nbuilding server bundle...\r\nrendering pages...\r\nbuild error:\r\n ReferenceError: ssrRender is not defined\r\n at Object.\u003Canonymous> (/Users/marina/Developer/formvuelatte/node_modules/vitepress/lib/app/temp/_assets/index.js:621:22)\r\n at Module._compile (internal/modules/cjs/loader.js:1133:30)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)\r\n at Module.load (internal/modules/cjs/loader.js:977:32)\r\n at Function.Module._load (internal/modules/cjs/loader.js:877:14)\r\n at Module.require (internal/modules/cjs/loader.js:1019:19)\r\n at require (internal/modules/cjs/helpers.js:77:18)\r\n at Object.renderPage (/Users/marina/Developer/formvuelatte/node_modules/vitepress/dist/build/render.js:12:27)\r\n at Object.build (/Users/marina/Developer/formvuelatte/node_modules/vitepress/dist/build/build.js:13:28)\r\n✨ Done in 3.61s.\r\n```\r\n\r\nThe line that seems to be crashing is line 12 in `node_modules/vitepress/dist/build/render.js`\r\n`const { createApp } = require(path_1.default.join(config.tempDir, '_assets/index.js'));`\r\n\r\n## Repo to reproduce\r\nTo reproduce you can check out: https://github.com/vuelidate/formvuelatte/tree/next",[],"Build throws error `ReferenceError: ssrRender is not defined`","2023-01-21T16:25:45Z","https://github.com/vuejs/vitepress/issues/12",0.6781868,{"description":2950,"labels":2951,"number":2955,"owner":2877,"repository":2878,"state":2891,"title":2956,"updated_at":2957,"url":2958,"score":2959},"### Describe the bug\n\n布局 home ,build以后不显示,最新版本\n\n### Reproduction\nlayout: home\n\nhero:\n name: xxx\n image:\n src: /logo.png\n tagline: xxx\n actions:\n - theme: brand\n text: xxx\n link: /x/xx\n\n\n### Expected behavior\n\n希望正常显示 layout:home\n\n### System Info\n\n```Text\n\"vitepress\": \"^2.0.0-alpha.5\",\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.",[2952],{"name":2953,"color":2954},"need more info","bdbefc",4744,"布局 home ,build以后不显示,最新版本","2025-05-13T03:47:00Z","https://github.com/vuejs/vitepress/issues/4744",0.679627,{"description":2961,"labels":2962,"number":2964,"owner":2877,"repository":2878,"state":2891,"title":2938,"updated_at":2965,"url":2966,"score":2967},"**Describe the bug**\r\nI try to use npm package QuillJS in .vitepress/theme/index.js\r\n```js\r\nimport Quill from \"quill\";\r\nlet quill = new Quill(\"#container\")\r\n```\r\nwhen I run `npm run dev` it works just fine\r\nbut when I run `npm run build` it failed\r\nand shows an error message: \r\n\r\n> build error:\r\n> ReferenceError: document is not defined\r\n> at Object.\\\u003Canonymous\\> (D:\\vueup-quill\\node_modules\\quill\\dist\\quill.js:7661:12)\r\n> at __webpack_require__ (D:\\vueup-quill\\node_modules\\quill\\dist\\quill.js:36:30)\r\n\r\n**Expected behavior**\r\nIt should work in dev and build mode.\r\n\r\n**System Info**\r\n- vitepress version: v0.12.2\r\n- vite version: v2.0.5\r\n- Node version: v14.15.4\r\n- OS version: Windows 10",[2963],{"name":2888,"color":2889},257,"2023-01-21T14:22:45Z","https://github.com/vuejs/vitepress/issues/257",0.68037933,["Reactive",2969],{},["Set"],["ShallowReactive",2972],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fOdZJu8oyEWc1EeUEkbj2OV1_NH6lo3FPRzBvBgC9EQM":-1},"/vuejs/vitepress/1727"]