`, 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.",[2914],{"name":2915,"color":2916},"question","5D5FAE",2627,"How should I trace build error?","2023-07-24T00:04:51Z","https://github.com/vuejs/vitepress/issues/2627",0.76857334,{"description":2923,"labels":2924,"number":2926,"owner":2871,"repository":2872,"state":2906,"title":2927,"updated_at":2928,"url":2929,"score":2930},"Hi, I'm using Backblaze + Cloudflare to host my images. When I'm using vitepress I found the images' response header `cf-cache-status` is always `MISS`.\r\n\r\nI checked the request header and I found `cache-control` and `pragma` values are both `no-cache`. When I imported the same request into Postman and modified both `cache-control` and `pragma` to `max-age=86400`, the response header `cf-cache-status` turned to `HIT`. I think the problem is here.\r\n\r\nIs there any method that I can configure the cache related request header of imgs?\r\n\r\nMany thanks!",[2925],{"name":2915,"color":2916},1763,"How to configure \"cache-control\" header when request remote imgs?","2023-01-06T05:47:47Z","https://github.com/vuejs/vitepress/issues/1763",0.7728509,{"description":2932,"labels":2933,"number":2936,"owner":2871,"repository":2872,"state":2906,"title":2937,"updated_at":2938,"url":2939,"score":2940},"### 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.",[2934,2935],{"name":2903,"color":2904},{"name":2868,"color":2869},2181,"How to use Vue plugins like I18N","2023-08-14T00:04:19Z","https://github.com/vuejs/vitepress/issues/2181",0.77545613,{"description":2942,"labels":2943,"number":2945,"owner":2871,"repository":2872,"state":2906,"title":2946,"updated_at":2947,"url":2948,"score":2949},"### 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.",[2944],{"name":2903,"color":2904},4595,"Why can't my code block render the title correctly?","2025-03-12T04:44:46Z","https://github.com/vuejs/vitepress/issues/4595",0.7784185,{"description":2951,"labels":2952,"number":2956,"owner":2871,"repository":2872,"state":2906,"title":2957,"updated_at":2958,"url":2959,"score":2960},"### Is your feature request related to a problem? Please describe.\r\n\r\n例如:\r\n- 当我部署在 github 渲染显示如下内容\r\n\r\n ```md\r\n git clone https://github.com/username/xxxx.git\r\n ```\r\n\r\n- 当我部署在 gitee 渲染显示如下内容\r\n\r\n ```md\r\n git clone https://gitee.com/username/xxxx.git\r\n ```\r\n\r\n\r\n\r\n### Describe the solution you'd like\r\n\r\nSupport:\r\n\r\n\u003Cpre>\r\n ```md {render=window.location.href.start('https://github.com')}\r\n git clone https://github.com/username/xxxx.git\r\n ```\r\n\u003C/pre>\r\n\r\n\u003Cpre>\r\n ```md {render=window.location.href.start('https://gitee.com')}\r\n git clone https://gitee.com/username/xxxx.git\r\n ```\r\n\u003C/pre>\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/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.",[2953],{"name":2954,"color":2955},"wont fix","EDEED1",3829,"支持 Markdown 动态渲染","2024-05-03T04:42:02Z","https://github.com/vuejs/vitepress/issues/3829",0.77980906,{"description":2962,"labels":2963,"number":2964,"owner":2871,"repository":2872,"state":2906,"title":2965,"updated_at":2966,"url":2967,"score":2968},"### Describe the bug\n\nWhen navigating to a VitePress site from any other domain (e.g. this link: [https://vitepress.vuejs.org/](https://vitepress.vuejs.org/)), the VitePress router adds a duplicate entry to the browser session's history stack. This occurs because [`history.pushState()` is called via `router.go()` ](https://github.com/vuejs/vitepress/blob/3b890e81774740bb92baf9ac305c1f9fb11d3d2f/src/client/app/index.ts#L132) on the initial page load.\r\n\r\nThe effect of this depends on the browser.\r\n\r\n- In Chromium-based browsers, due to implementing [History Manipulation Intervention](https://groups.google.com/a/chromium.org/g/blink-dev/c/T8d4_BRb2xQ/m/WSdOiOFcBAAJ), the back button works as expected and the user returns to the previous page (e.g. this page).\r\n \r\n- Safari implements something similar and the back button also works as expected.\r\n \r\n- In Firefox, the user has to click the back button twice to return.\r\n \r\nIn all cases, the duplicate entry is still visible in the history stack.\n\n### Reproduction\n\n1. Visit [https://vitepress.vuejs.org/](https://vitepress.vuejs.org/) by left clicking the link.\r\n2. Right click (if Safari, long press) on the browser's back button and notice there is an extra entry.\n\n### Expected behavior\n\nThe extra entry is not added, like when visiting [https://developer.mozilla.org/en-US/](https://developer.mozilla.org/en-US/).\n\n### System Info\n\n```shell\nSystem:\r\n OS: Linux 6.1 Arch Linux\r\n CPU: (16) x64 AMD Ryzen 7 5700G with Radeon Graphics\r\n Memory: 23.05 GB / 30.74 GB\r\n Container: Yes\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 16.19.0 - /usr/bin/node\r\n npm: 8.19.2 - /usr/bin/npm\r\n Browsers:\r\n Chromium: 109.0.5414.74\r\n Firefox: 108.0.2\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.",[],1792,"Router adds duplicate entry to session history stack","2023-01-29T00:04:24Z","https://github.com/vuejs/vitepress/issues/1792",0.7845121,["Reactive",2970],{},["Set"],["ShallowReactive",2973],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fTmHjyJH91x3kC9fmKaOx4PXeuyzbONqKDsgl-2qp13Y":-1},"/vuejs/vitepress/4597"]