\n\n请问使用的库打包文件中有Worker,但是打包环境没有worker切报错应该怎么解决?\n\n",[],4937,"构建时报错 Worker is not defined","2025-09-08T08:34:41Z","https://github.com/vuejs/vitepress/issues/4937",0.78440315,{"description":3182,"labels":3183,"number":3187,"owner":3155,"repository":3156,"state":3188,"title":3189,"updated_at":3190,"url":3191,"score":3192},"### Describe the bug\n\nWhen I was looking at the official documentation, I noticed that the code blocks on the official website can display titles, just like this:\n\n\n\nI didn't find an introduction on how to add a code block title in the official website guide, so I went to look at the source code.\n\n\n\nI tried to implement this function locally by myself.\n\n\n\n\n\nBut it has no effect. The title is not displayed locally.\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-nwie7gju?file=docs%2Fexample.md\n\nThere is also no successful title displayed here. I want to know how vitepress.dev achieves this. I didn't see the configuration related to markdown in.vitepress/config.js (maybe I didn't find it?).\n\n### Expected behavior\n\nI hope that code blocks can support title display like the official website.\n\n### System Info\n\n```Text\nWindows 11 Pro\nnode: v22.13.0\nnpm: 10.9.2\npnpm: pnpm@10.4.1\nvitepress:^1.6.3\nEdge: 133.0.3065.92\n```\n\n### Additional context\n\nMy local version of vitepress is 1.6.3. I checked the changelog on the official website and did not find any relevant change notifications (including those after version 2.0). \n\nAt the same time, the provided stackblitz by default pulls the latest version of vitepress (presumably a version after 2.0). However, the same official website effect did not appear. This is puzzling.\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.",[3184],{"name":3185,"color":3186},"bug: pending triage","e99695",4595,"closed","Why can't my code block render the title correctly?","2025-03-12T04:44:46Z","https://github.com/vuejs/vitepress/issues/4595",0.76160264,{"description":3194,"labels":3195,"number":3196,"owner":3155,"repository":3156,"state":3188,"title":3197,"updated_at":3198,"url":3199,"score":3200},"### Is your feature request related to a problem? Please describe.\r\n\r\nMade the doc work locally in an old fashion way ( no need of server, you open the index and arrive into the doc )..\r\n\r\nA single file ideally.\r\n\r\n### Describe the solution you'd like\r\n\r\nAdd a --singlefile option to made all package in it.\r\n\r\n### Describe alternatives you've considered\r\n\r\nI checkout vite-plugin-singlefile and a guy made it work with vite & vue but I coudnt find a way to made it work in vitepress \r\n\r\nhttps://stackoverflow.com/questions/67031295/how-to-open-a-static-website-in-localhost-but-generated-with-vite-and-without-ru#comment118485222_67031295\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] 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.",[],1889,"Vitepress locally ","2023-02-11T00:04:26Z","https://github.com/vuejs/vitepress/issues/1889",0.7696763,{"description":3202,"labels":3203,"number":3206,"owner":3155,"repository":3156,"state":3188,"title":3207,"updated_at":3208,"url":3209,"score":3210},"### Describe the bug\n\nSo I'm starting a [components library called Vuersatile components](https://github.com/Brugarolas/vuersatile-components). And I decided to use `Vitepress` for the documentation.\r\n\r\nAnd I can't even go beyond my first component page, Checkbox. Page is not rendering at all and I found the cause looking at the console:\r\n\r\n```js\r\nUncaught (in promise) TypeError: this.$t is not a function\r\n computedSubmitText Form.vue:129\r\n run reactivity.esm-bundler.js:190\r\n get value reactivity.esm-bundler.js:1171\r\n get runtime-core.esm-bundler.js:3488\r\n render Form.vue:33\r\n renderComponentRoot runtime-core.esm-bundler.js:914\r\n componentUpdateFn runtime-core.esm-bundler.js:5649\r\n run reactivity.esm-bundler.js:190\r\n update runtime-core.esm-bundler.js:5763\r\n setupRenderEffect runtime-core.esm-bundler.js:5777\r\n```\r\n\r\nAfter hours of searching (cause let's see honest, this library docs are missing some essential things), I haven't found still how to customize my own `createApp` with `Vitepress`.\r\n\r\nCan somebody please help?\r\n\r\n\n\n### Reproduction\n\nClone [my repository Vuersatile components](https://github.com/Brugarolas/vuersatile-components).\r\n\r\nInit the docs with `npm run docs:dev`\r\n\r\nGo to [Checkbox page](http://localhost:5173/components/form/checkbox.html).\r\n\r\nPage is not rendering. Open the console to see the error.\n\n### Expected behavior\n\nPlugin `i18n` to work and don't throw any errors on the console.\n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.22621\r\n CPU: (16) x64 AMD Ryzen 9 5900HX with Radeon Graphics \r\n Memory: 53.36 GB / 63.42 GB\r\n Binaries:\r\n Node: 18.13.0 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 8.19.3 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22621.1413.0), Chromium (111.0.1661.62)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.64 => 1.0.0-alpha.64\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.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[3204,3205],{"name":3185,"color":3186},{"name":3166,"color":3167},2181,"How to use Vue plugins like I18N","2023-08-14T00:04:19Z","https://github.com/vuejs/vitepress/issues/2181",0.77115345,{"description":3212,"labels":3213,"number":3214,"owner":3155,"repository":3156,"state":3188,"title":3215,"updated_at":3216,"url":3217,"score":3218},"### Describe the bug\n\nLine numbers don't work correctly with code group.\r\n\n\n### Reproduction\n\nEnable line numbers:\r\n\r\nAdd code group:\r\n\r\n\n\n### Expected behavior\n\n\r\n\n\n### System Info\n\n```shell\nSystem: \r\n OS: Windows 10 10.0.19045 \r\n CPU: (6) x64 Intel(R) Core(TM) i5-9600KF CPU @ 3.70GHz\r\n Memory: 1.83 GB / 15.94 GB \r\n Binaries:\r\n Node: 18.7.0 - 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.19041.1266.0), Chromium (107.0.1418.35)\r\n npmPackages:\r\n vitepress: 1.0.0-alpha.28 => 1.0.0-alpha.28\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.",[],1594,"Line numbers don't work correctly with code group.","2023-01-21T14:20:46Z","https://github.com/vuejs/vitepress/issues/1594",0.77421373,{"description":3220,"labels":3221,"number":3226,"owner":3155,"repository":3156,"state":3188,"title":3227,"updated_at":3228,"url":3229,"score":3230},"### Describe the bug\n\nI am using viteprss to set up a document system, but my document placement is arbitrary so I use fast-glob to scan all documents and generate a routing table including slider and nav and then soft link to the vitepress working directory. The problem now is that when I delete a file, I need to regenerate the routes and let the slider and nav update. However, using the restart method in the configServer in the vite plugin, I found that vitepress could not re-read the configuration table I had generated\r\n\r\n\r\n\r\n```js\r\n// .vitepress/config.js\r\nconst routes = fs.readJSONSync(join(__dirname, 'routes.json'));\r\n\r\nexport default {\r\n ...,\r\n themeConfig: {\r\n // https://vitepress.dev/reference/default-theme-config\r\n nav: routes.nav,\r\n sidebar: routes.sidebar,\r\n },\r\n}\r\n\r\n```\r\n\r\n```ts\r\n// vite plugin\r\n\r\nexport const folderWatcherPlugin = (): Plugin => {\r\n let watcher: chokidar.FSWatcher | null = null;\r\n let padding = false;\r\n\r\n async function onFileAddUnlink(server: ViteDevServer) {\r\n\r\n if (padding) return;\r\n padding = true;\r\n // generate routers\r\n await setup();\r\n\r\n await server.restart();\r\n padding = false;\r\n }\r\n\r\n return {\r\n name: 'folder-watcher-plugin',\r\n apply: 'serve',\r\n enforce: 'pre',\r\n async configureServer(server) {\r\n const docsConfig = (await import('../../../xcs-docs.config')).default;\r\n const scanPaths = docsConfig.resolver.map((item) =>\r\n join(root, item.scan_path),\r\n );\r\n\r\n const ignoreScanPaths = docsConfig.resolver\r\n .map((item) => item.ignore)\r\n .filter(Boolean) as string[];\r\n\r\n watcher = chokidar.watch(scanPaths, {\r\n ignored: ['**/.git/**', '**/node_modules/**'],\r\n ignoreInitial: true,\r\n });\r\n console.log('watcher start', scanPaths);\r\n\r\n watcher.on('add', (...args) => {\r\n onFileAddUnlink(server);\r\n });\r\n\r\n watcher.on('unlink', (...args) => {\r\n onFileAddUnlink(server);\r\n });\r\n },\r\n async closeBundle() {\r\n await watcher?.close();\r\n },\r\n };\r\n};\r\n```\r\n\r\n\r\n\n\n### Reproduction\n\nnone\n\n### Expected behavior\n\nvitepress is able to restart reading the routing table and restart the service to make the page reload\r\n\n\n### System Info\n\n```Text\nSystem:\r\n OS: macOS 14.2\r\n CPU: (8) arm64 Apple M2\r\n Memory: 66.55 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 18.20.2 - ~/Library/Caches/fnm_multishells/24582_1720404615717/bin/node\r\n Yarn: 1.22.22 - ~/Library/Caches/fnm_multishells/24582_1720404615717/bin/yarn\r\n npm: 10.5.0 - ~/Library/Caches/fnm_multishells/24582_1720404615717/bin/npm\r\n pnpm: 9.0.6 - ~/Library/Caches/fnm_multishells/24582_1720404615717/bin/pnpm\r\n Browsers:\r\n Chrome: 126.0.6478.182\r\n Safari: 17.2\r\n npmPackages:\r\n vitepress: ^1.3.0 => 1.3.0\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.",[3222,3225],{"name":3223,"color":3224},"build","377ba8",{"name":3166,"color":3167},4054,"How do I restart the vitepress service?","2024-10-23T04:43:31Z","https://github.com/vuejs/vitepress/issues/4054",0.7850363,{"description":3232,"labels":3233,"number":3237,"owner":3155,"repository":3156,"state":3188,"title":3238,"updated_at":3239,"url":3240,"score":3241},"### Describe the bug\r\n\r\nI'm getting some errors when running `pnpm build`, I guess it's because I should somehow wrap this component causing the error in `\u003CClientOnly />`, but how should I find the exact cause from the error log? It does not provide any useful details (see below screenshot)\r\n\r\n---\r\n\r\nAnother question, as I guess my error is because of this:\r\nShould I wrap `watch()` inside `onMounted()`? or in another word, can I do it? I didn't find any corresponding example in Vue documentation... \r\nSorry if this is a dumb question, as I'm a react guy :(\r\n```vue\r\n\u003Cscript setup lang=\"ts\">\r\nimport { useLocalStorage } from '@vueuse/core';\r\nimport { watch } from 'vue';\r\n\r\nconst nfcapiEnvRef = useLocalStorage('vp-nfcapi-env', 'staging', {\r\n deep: false,\r\n listenToStorageChanges: true,\r\n writeDefaults: true\r\n});\r\n\r\nwatch(nfcapiEnvRef, (value, oldValue) => {\r\n const htmlDataSet = document.documentElement.dataset;\r\n oldValue && (htmlDataSet.nfcapiEnv = oldValue.toLowerCase());\r\n htmlDataSet.nfcapiEnv = value.toLowerCase();\r\n}, { immediate: true });\r\n\u003C/script>\r\n```\r\n\r\n---\r\n\r\nScreenshot of the error:\r\n\r\n\r\n\r\n\r\n\r\n### Reproduction\r\n\r\nThis is not a bug, but a question\r\n\r\n### Expected behavior\r\n\r\nN/A\r\n\r\n### System Info\r\n\r\n```sh\r\nSystem:\r\n OS: Windows 10 10.0.19045\r\n CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz\r\n Memory: 30.87 GB / 63.84 GB\r\n Binaries:\r\n Node: 18.16.0 - C:\\NodeJS\\node.EXE\r\n Yarn: 1.22.19 - C:\\NodeJS\\yarn.CMD\r\n npm: 9.8.0 - C:\\NodeJS\\npm.CMD\r\n pnpm: 8.6.7 - C:\\NodeJS\\pnpm.CMD\r\n Browsers:\r\n Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.82)\r\n Internet Explorer: 11.0.19041.1566\r\n npmPackages:\r\n vitepress: ^1.0.0-beta.5 => 1.0.0-beta.5\r\n```\r\n\r\n\r\n### Additional context\r\n\r\nN/A\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.",[3234],{"name":3235,"color":3236},"question","5D5FAE",2627,"How should I trace build error?","2023-07-24T00:04:51Z","https://github.com/vuejs/vitepress/issues/2627",0.79080313,{"description":3243,"labels":3244,"number":3246,"owner":3155,"repository":3156,"state":3188,"title":3247,"updated_at":3248,"url":3249,"score":3250},"### Is your feature request related to a problem? Please describe.\n\nThe current picture is not clear\n\n### Describe the solution you'd like\n\nMake the same logo in SVG format\n\n### Describe alternatives you've considered\n\nIncrease the clarity of the main icon\n\n### Additional context\n\nIn my opinion, it would be much better if the main icon was in SVG format, because the current one is not very clear (at least it is visible on a 2.8K display)\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.",[3245],{"name":3166,"color":3167},4198,"Make the main icon on the site in svg format","2025-03-19T01:31:04Z","https://github.com/vuejs/vitepress/issues/4198",0.79126817,["Reactive",3252],{},["Set"],["ShallowReactive",3255],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f66G5j4VpSxqidghO4Sb7phrEmk9KRWQPfX-79EUCFWo":-1},"/vuejs/vitepress/4678"]