\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.67775553,{"description":2885,"labels":2886,"number":2888,"owner":2877,"repository":2878,"state":2889,"title":2890,"updated_at":2891,"url":2892,"score":2893},"### Describe the bug\n\nI'm trying to migrate my documentation from a regular Vite setup to Vitepress.\r\nEverything works fine when using `vitepress dev` (except that the CSS is sometimes broken upon first load).\r\nHowever, `vitepress build` fails with the following output:\r\n\r\n```\r\n$ vitepress build docs\r\nvitepress v0.20.9\r\n✓ building client + server bundles...\r\n- rendering pages...\r\nError [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/d3/src/index.js from /home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/demo_index.md.js not supported.\r\nInstead change the require of index.js in /home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/demo_index.md.js to a dynamic import() which is available in all CommonJS modules.\r\n at Module.\u003Canonymous> (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/demo_index.md.js:25:10)\r\n at /home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:1621:12\r\n at loadPage (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:163:18)\r\n at Object.go (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:156:12)\r\n at renderPage (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/node/serve-61783397.js:40037:10)\r\n at Object.build (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/node/serve-61783397.js:40169:15) {\r\n code: 'ERR_REQUIRE_ESM'\r\n}\r\n✖ rendering pages...\r\nbuild error:\r\n TypeError: Cannot read properties of null (reading 'frontmatter')\r\n at ReactiveEffect.fn (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:91:48)\r\n at ReactiveEffect.run (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:153:29)\r\n at ComputedRefImpl.get value [as value] (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:1010:39)\r\n at ReactiveEffect.fn (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:1259:23)\r\n at ReactiveEffect.run (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:153:29)\r\n at ComputedRefImpl.get value [as value] (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:1010:39)\r\n at ReactiveEffect.fn (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:1279:36)\r\n at ReactiveEffect.run (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:153:29)\r\n at ComputedRefImpl.get value [as value] (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:1010:39)\r\n at Object.unref (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:923:29)\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```\n\n### Reproduction\n\n1. Use d3 as a dependency.\r\n2. Run `vitepress build`\n\n### Expected behavior\n\nThe build passes.\n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.22000\r\n CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor \r\n Memory: 14.80 GB / 31.92 GB\r\n Binaries:\r\n Node: 16.13.0 - C:\\Program Files\\nodejs\\node.EXE\r\n Yarn: 1.22.15 - ~\\AppData\\Roaming\\npm\\yarn.CMD\r\n npm: 7.20.3 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22000.120.0), Chromium (96.0.1054.62)\r\n Internet Explorer: 11.0.22000.120\r\n npmPackages:\r\n vitepress: 0.20.9 => 0.20.9\n```\n\n\n### Additional context\n\nA reproducing repository is available at https://github.com/DerYeger/d3-graph-controller and a log of the error can be found at https://github.com/DerYeger/d3-graph-controller/runs/4618930216?check_suite_focus=true.\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.",[2887],{"name":2868,"color":2869},476,"closed","`vitepress build` fails with `ERR_REQUIRE_ESM`","2023-01-21T14:25:31Z","https://github.com/vuejs/vitepress/issues/476",0.64558583,{"description":2895,"labels":2896,"number":2900,"owner":2877,"repository":2878,"state":2889,"title":2901,"updated_at":2902,"url":2903,"score":2904},"### Describe the bug\r\n\r\nSince after vitepress@1.0.0-alpha.66 has update vueuse to v10.x, while elment-plus@2.3.3 still using vueuse@9.x, build will fail like that:\r\n\r\n```\r\nfile:///home/projects/vite-prhpmo/docs/.vitepress/.temp/app.js:3\r\nimport { isClient, isNumber, useEventListener, useThrottleFn, useMediaQuery, useWindowScroll } from \"@vueuse/core\";\r\n ^^^^^^^^\r\nSyntaxError: The requested module '@vueuse/core' does not provide an export named 'isNumber'\r\n at async ModuleJob.run (https://viteprhpmo-pjkg.w-credentialless.staticblitz.com/blitz.c8358679.js:35:1077745)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (https://viteprhpmo-pjkg.w-credentialless.staticblitz.com/blitz.c8358679.js:35:1312625)\r\n at async Module.build (file://file:///home/projects/vite-prhpmo/node_modules/vitepress/dist/node/serve-4d1b4005.js:41686:24)\r\n```\r\n\r\nIsNumber was removed in vueuse v10.x. what generated in `.temp/app.js` since didn't solve the different version of vueuse.\r\n\r\nAt that moment I was using yarn v1.x, and then I change to npm, after reinstall, it build success.\r\n\r\nI'm not sure it was the problem of pakage manager or vite/vitepress, or element-plus, or something else...\r\n\r\nAnd this issue #2187 may be related.\r\n\r\n### Reproduction\r\n\r\nHere is two Reproduction:\r\n\r\nwith yarn, build failed:\r\n[https://stackblitz.com/edit/vite-prhpmo?file=docs/.vitepress/config.ts\r\n](https://stackblitz.com/edit/vite-prhpmo?file=docs/.vitepress/config.ts\r\n)\r\n\r\nwith npm, build success:\r\n[https://stackblitz.com/edit/vite-wwmku1?file=docs/.vitepress/config.ts](https://stackblitz.com/edit/vite-wwmku1?file=docs/.vitepress/config.ts)\r\n\r\nwith pnpm build success too.\r\n\r\nwhat I found is that on the root of node_modules folder, yarn install vueuse@10.x while other package manager install v9.x\r\n\r\n### Expected behavior\r\n\r\nBuild success while using yarn.\r\n\r\n### System Info\r\n\r\n```shell\r\nJust see stackblitz demo.\r\n```\r\n\r\n\r\n### Additional context\r\n\r\nyarn\r\n\r\n\r\nnpm\r\n\r\n\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.",[2897],{"name":2898,"color":2899},"bug: pending triage","e99695",2255,"Using Vitepress and Element Plus at the same time and building with Yarn will fail.","2023-04-26T00:04:10Z","https://github.com/vuejs/vitepress/issues/2255",0.6562702,{"description":2906,"labels":2907,"number":2911,"owner":2877,"repository":2878,"state":2889,"title":2912,"updated_at":2913,"url":2914,"score":2915},"### Is your feature request related to a problem? Please describe.\r\n\r\nWhen I use Element-Plus in VitePress, the partial style of the component is modified. The reason is VitePress `src/client/theme-default/styles/layout.css` File reset all styles.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n### Describe the solution you'd like\r\n\r\nI hope this code only takes effect in VitePress.\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\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] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/master/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2908],{"name":2909,"color":2910},"duplicate","cfd3d7",434,"This is a suggestion","2023-01-21T16:04:15Z","https://github.com/vuejs/vitepress/issues/434",0.6612318,{"description":2917,"labels":2918,"number":2922,"owner":2877,"repository":2878,"state":2889,"title":2923,"updated_at":2924,"url":2925,"score":2926},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\nwhen i was included element-plus as official document , but there was error about vue3 proxy\r\n index.esm.js: 1 Uncaught (in promise) TypeError: Cannot read property 'proxy' of null\r\n\r\n**To Reproduce**\r\n1.git clone from https://github.com/zhaowenlin/demo\r\n2.yarn install\r\n3.npm run dev\r\n4.访问http://localhost:3000/\r\n5.点击快速上手\r\n\r\n**Expected behavior**\r\nrender normally\r\n\r\n**System Info**\r\n- vitepress version: 0.12.2\r\n- vite version:2.1.5\r\n- Node version: 14.15.5\r\n- OS version: 10.14.6\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n",[2919],{"name":2920,"color":2921},"question","5D5FAE",282,"vitepress not support element-plus? ","2023-01-21T14:35:38Z","https://github.com/vuejs/vitepress/issues/282",0.6681161,{"description":2928,"labels":2929,"number":2930,"owner":2877,"repository":2878,"state":2889,"title":2931,"updated_at":2932,"url":2933,"score":2934},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\nI started building a custom theme and haven't imported any css to `index.js` yet. Running `vitepress build` throws an error:\r\n```\r\n$ vitepress build\r\nvitepress v0.11.4\r\nvite v2.0.0-beta.35\r\n✓ building client + server bundles...\r\n✖ rendering pages...\r\nbuild error:\r\n TypeError: Cannot read property 'fileName' of undefined\r\n at Object.renderPage (/Users/fistmenaruto/Projects/domnantas.lt/node_modules/vitepress/dist/node/build/render.js:53:61)\r\n at async Object.build (/Users/fistmenaruto/Projects/domnantas.lt/node_modules/vitepress/dist/node/build/build.js:29:17)\r\nerror Command failed with exit code 1.\r\n```\r\n\r\n`render.js:53` is trying to get `cssChunk.fileName`:\r\n```jsx\r\n\u003Clink rel=\"stylesheet\" href=\"${siteData.base}${cssChunk.fileName}\">\r\n```\r\nbut it is undefined since there are not css chunks.\r\n\r\nThe same happens if you try to import an empty .css file to `index.js`.\r\n\r\n`vitepress dev` does not throw the error.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n- Create an empty custom theme as described in the docs: https://vitepress.vuejs.org/guide/customization.html#customization\r\n(notice how there are no .css imports in the docs either)\r\n- Run `vitepress build`\r\n\r\nReproduction repo: https://github.com/domnantas/domnantas.lt/tree/no-css-chunks\r\n\r\n**Expected behavior**\r\nBuild should not fail when building without css\r\n\r\n**System Info**\r\n- vitepress version: v0.11.4\r\n- vite version: v2.0.0-beta.35\r\n- Node version: v15.5.1\r\n- OS version: MacOS 11.0.1\r\n\r\n**Additional context**\r\n```js\r\n`\r\n...\r\n${cssChunk ? `\u003Clink rel=\"stylesheet\" href=\"${siteData.base}${cssChunk.fileName}\">` : \"\"}\r\n...\r\n`\r\n```\r\nwould fix this, but maybe there are better ways\r\n",[],209,"Build fails with custom theme and no css","2023-01-21T16:22:25Z","https://github.com/vuejs/vitepress/issues/209",0.66875476,{"description":2936,"labels":2937,"number":2941,"owner":2877,"repository":2878,"state":2889,"title":2942,"updated_at":2943,"url":2944,"score":2945},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\n\r\nAdding a simple directive inside a markdown file or an SFC throws an error during the build. Seems like ClientOnly component does not exist yet in VitePress.\r\n\r\n`Custom directive is missing corresponding SSR transform and will be ignored.`\r\n\r\n**To Reproduce**\r\n\r\n\r\n```\r\n\u003Cdiv v-test>test\u003C/div>\r\n\r\n\r\n\u003Cscript>\r\nexport default {\r\n directives: {\r\n test: {\r\n mounted(el, binding) {\r\n console.log(el)\r\n }\r\n }\r\n }\r\n}\r\n\u003C/script>\r\n```\r\n\r\n\r\n**Expected behavior**\r\nBuild should work even though an SSR implementation for the custom directive doesn't exist.\r\n\r\n**System Info**\r\n- vitepress version: 0.6.0\r\n- vite version: v1.0.0-rc.4\r\n- Node version: 12.18.3\r\n- OS version: Catalina 10.15.6\r\n\r\n**Additional context**\r\nNone.\r\n",[2938],{"name":2939,"color":2940},"docs","0075ca",92,"Build fails due to custom directive missing an SSR Transform","2023-01-21T14:26:34Z","https://github.com/vuejs/vitepress/issues/92",0.6705731,{"description":2947,"labels":2948,"number":2950,"owner":2877,"repository":2878,"state":2889,"title":2951,"updated_at":2952,"url":2953,"score":2954},"### Describe the bug\n\nHey, \r\n\r\nIt's not a bug report, just a question.\r\n\r\nHow to install with a module who's use browser features (document.querySelectorAll) with `ctx.app.use()` on client side ? \r\n\r\nI can't find the way in the documentation. In VuePress, we can use the variable `__VUEPRESS_SSR__`, do you something similar in VitePress ? \r\n\r\nN.B: It's works fine with the dev serve but fail on build time\r\n\r\n## In VuePress\r\n\r\n`docs/.vuepress/client.ts`\r\n\r\n```ts\r\nimport { defineClientConfig } from '@vuepress/client'\r\nimport { clientModule } from 'lib'\r\n\r\nexport default defineClientConfig({\r\n enhance: async ({ app, router }) => {\r\n if (!__VUEPRESS_SSR__) {\r\n app.use(clientModule)\r\n }\r\n }\r\n})\r\n```\r\n\r\n## In VitePress \r\n\r\n`docs/.vitepress/theme/index.ts`\r\n\r\n```ts\r\nconst theme: typeof DefaultTheme = {\r\n ...DefaultTheme,\r\n enhanceApp({ app }) {\r\n app.use(clientModule) // It's doesn't works 😑\r\n },\r\n}\r\n```\r\n\r\n\n\n### Reproduction\n\n-\n\n### Expected behavior\n\nBe able to build the app with client\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 12.6.1\r\n CPU: (10) arm64 Apple M1 Pro\r\n Memory: 314.09 MB / 16.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 16.18.1 - /opt/homebrew/opt/node@16/bin/node\r\n Yarn: 1.22.19 - ~/.yarn/bin/yarn\r\n npm: 8.19.2 - /opt/homebrew/opt/node@16/bin/npm\r\n Browsers:\r\n Chrome: 108.0.5359.98\r\n Firefox: 101.0.1\r\n Safari: 15.6.1\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.30 => 1.0.0-alpha.30\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.",[2949],{"name":2898,"color":2899},1681,"[QUESTION] checking if in client side to install plugin","2023-01-21T14:20:27Z","https://github.com/vuejs/vitepress/issues/1681",0.6742742,{"description":2956,"labels":2957,"number":2959,"owner":2877,"repository":2878,"state":2889,"title":2960,"updated_at":2961,"url":2962,"score":2963},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\nOn current `master`, `yarn build` failed due to typing error.\r\n\r\n```\r\nsrc/client/app/utils.ts:20:32 - error TS2339: Property 'env' does not exist on type 'ImportMeta'.\r\n\r\n20 const base = import.meta.env.BASE_URL\r\n ~~~\r\n\r\nFound 8 errors.\r\n```\r\n\r\n**To Reproduce**\r\n- Clone, `yarn` and then `yarn build`\r\n\r\n**Additional context**\r\nFix PR made: https://github.com/vuejs/vitepress/pull/44\r\n",[2958],{"name":2898,"color":2899},47,"Failed to build ","2023-01-21T16:25:38Z","https://github.com/vuejs/vitepress/issues/47",0.67513865,{"description":2965,"labels":2966,"number":2968,"owner":2877,"repository":2878,"state":2889,"title":2969,"updated_at":2970,"url":2971,"score":2972},"### Describe the bug\r\n\r\nThere is no problem in the development environment, but an error was thrown during packaging execution\r\n\u003Cimg width=\"1320\" alt=\"image\" src=\"https://github.com/vuejs/vitepress/assets/142566415/3a33fbd2-7d53-4bee-b0d0-db8ded2b047d\">\r\n\r\n### Reproduction\r\n\r\nFor development - npm run docs:dev\r\nFor build - npm run docs:build\r\n\r\nEquivalent stackblitz links:\r\n[https://stackblitz.com/edit/vite-dkrbry](https://stackblitz.com/edit/vite-dkrbry)\r\n\r\n### Expected behavior\r\n\r\nProduction should match with development.\r\n\r\n### System Info\r\n\r\n```Text\r\nSystem:\r\n OS: Linux 5.0 undefined\r\n CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz\r\n Memory: 0 Bytes / 0 Bytes\r\n Shell: 1.0 - /bin/jsh\r\n Binaries:\r\n Node: 18.18.0 - /usr/local/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 9.4.2 - /usr/local/bin/npm\r\n npmPackages:\r\n vitepress: latest => 1.0.0-rc.35\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.",[2967],{"name":2898,"color":2899},3425," XXX is not supported resolving ES modules imported from XXX","2024-01-18T00:04:43Z","https://github.com/vuejs/vitepress/issues/3425",0.6754231,["Reactive",2974],{},["Set"],["ShallowReactive",2977],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f02cav3vSVuI1-zUI105WrPXocI0jnsIpoyxs8Edu5_U":-1},"/vuejs/vitepress/1164"]