\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.",[3019,3022,3025],{"name":3020,"color":3021},"build","377ba8",{"name":3023,"color":3024},"has-workaround","1B4515",{"name":3026,"color":3027},"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.68817854,{"description":3037,"labels":3038,"number":3042,"owner":3029,"repository":3030,"state":3043,"title":3044,"updated_at":3045,"url":3046,"score":3047},"### 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.",[3039],{"name":3040,"color":3041},"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":3049,"labels":3050,"number":3054,"owner":3029,"repository":3030,"state":3043,"title":3055,"updated_at":3056,"url":3057,"score":3058},"### 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.",[3051],{"name":3052,"color":3053},"question","5D5FAE",1120,"document is not defined","2023-01-21T14:28:51Z","https://github.com/vuejs/vitepress/issues/1120",0.6527119,{"description":3060,"labels":3061,"number":3063,"owner":3029,"repository":3030,"state":3043,"title":3064,"updated_at":3065,"url":3066,"score":3067},"### 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.",[3062],{"name":3052,"color":3053},3001,"Support to show page contributors","2023-10-01T00:04:52Z","https://github.com/vuejs/vitepress/issues/3001",0.662829,{"description":3069,"labels":3070,"number":3072,"owner":3029,"repository":3030,"state":3043,"title":3073,"updated_at":3074,"url":3075,"score":3076},"### 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.",[3071],{"name":3040,"color":3041},3583,"document is not defined when vitepress build","2024-02-27T00:05:55Z","https://github.com/vuejs/vitepress/issues/3583",0.66396385,{"description":3078,"labels":3079,"number":3080,"owner":3029,"repository":3030,"state":3043,"title":3081,"updated_at":3082,"url":3083,"score":3084},"### 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":3086,"labels":3087,"number":3089,"owner":3029,"repository":3030,"state":3043,"title":3090,"updated_at":3091,"url":3092,"score":3093},"### 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.",[3088],{"name":3040,"color":3041},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":3095,"labels":3096,"number":2391,"owner":3029,"repository":3030,"state":3043,"title":3097,"updated_at":3098,"url":3099,"score":3100},"## 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":3102,"labels":3103,"number":3107,"owner":3029,"repository":3030,"state":3043,"title":3108,"updated_at":3109,"url":3110,"score":3111},"### 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.",[3104],{"name":3105,"color":3106},"need more info","bdbefc",4744,"布局 home ,build以后不显示,最新版本","2025-05-13T03:47:00Z","https://github.com/vuejs/vitepress/issues/4744",0.679627,{"description":3113,"labels":3114,"number":3116,"owner":3029,"repository":3030,"state":3043,"title":3090,"updated_at":3117,"url":3118,"score":3119},"**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",[3115],{"name":3040,"color":3041},257,"2023-01-21T14:22:45Z","https://github.com/vuejs/vitepress/issues/257",0.68037933,["Reactive",3121],{},["Set"],["ShallowReactive",3124],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fOdZJu8oyEWc1EeUEkbj2OV1_NH6lo3FPRzBvBgC9EQM":-1},"/vuejs/vitepress/1727"]