`, 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":2891,"color":2892},2627,"How should I trace build error?","2023-07-24T00:04:51Z","https://github.com/vuejs/vitepress/issues/2627",0.7170338,{"description":2921,"labels":2922,"number":2924,"owner":2877,"repository":2878,"state":2906,"title":2925,"updated_at":2926,"url":2927,"score":2928},"There are certain edge cases where client-side filename sanitization doesn't work as expected and fails the builds / causes hydration issues.\r\n\r\nAnd handle these issues:\r\n\r\n- Remove leading underscore(s) from final assets\r\n- Handle special characters in filenames",[2923],{"name":2868,"color":2869},1472,"Match server and client-side filename sanitization","2023-01-21T14:25:10Z","https://github.com/vuejs/vitepress/issues/1472",0.7402646,{"description":2930,"labels":2931,"number":2932,"owner":2877,"repository":2878,"state":2906,"title":2933,"updated_at":2934,"url":2935,"score":2936},"\r\n\r\n有大佬可以帮忙指导下这是什么问题吗",[],1387,"最新版本出现这样","2023-01-21T14:25:27Z","https://github.com/vuejs/vitepress/issues/1387",0.7440843,{"description":2938,"labels":2939,"number":2940,"owner":2877,"repository":2878,"state":2906,"title":2941,"updated_at":2942,"url":2943,"score":2944},"### 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.7496032,{"description":2946,"labels":2947,"number":2949,"owner":2877,"repository":2878,"state":2906,"title":2950,"updated_at":2951,"url":2952,"score":2953},"### Describe the bug\r\n\r\nI wrote a vitepress plugin, and use 'console.log()' for printing logs\r\n\r\n\r\n\r\nuse plugin\r\n\r\n\r\n\r\n\r\nHowever, after I installed the plugin using yarn, these statements became invalid\r\n\r\nBut, these logs can be printed normally in the previous version of vitepress, but not in this version(Only files in node_modules cannot be printed, other locations are normal)\r\n\r\n\r\n\r\n\r\n\r\n### Reproduction\r\n\r\nSee my plugin\r\n\r\n[vitepress-plugin-codeblocks-fold](https://github.com/T-miracle/vitepress-plugin-codeblocks-fold)\r\n\r\n### Expected behavior\r\n\r\nExpect 'console.log()' to print logs normally\r\n\r\n### System Info\r\n\r\n```shell\r\nSystem:\r\n OS: Windows 10 10.0.22621\r\n CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz\r\n Memory: 17.21 GB / 31.70 GB\r\n Binaries:\r\n Node: 18.16.0 - C:\\Software\\nodejs\\node.EXE\r\n Yarn: 1.22.19 - ~\\AppData\\Roaming\\npm\\yarn.CMD\r\n npm: 9.5.1 - C:\\Software\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22621.1555.0), Chromium (112.0.1722.39)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.47 => 1.0.0-alpha.64\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] 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.",[2948],{"name":2903,"color":2904},2228,"After the self-written vitepress plugin is installed using yarn, logs cannot be printed on the console in it","2023-04-24T00:04:05Z","https://github.com/vuejs/vitepress/issues/2228",0.7623923,{"description":2955,"labels":2956,"number":2958,"owner":2877,"repository":2878,"state":2906,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### Describe the bug\n\nI have a custom component that renders an image for each markdown. It works fine running in dev, but not when building. VitePress does not detect it and copy it to the assets folder\n\n### Reproduction\n\n`VPDocHeader.vue`\r\n\r\n```vue\r\n\u003Cscript setup>\r\nimport { useData } from 'vitepress/dist/client/theme-default/composables/data'\r\nimport { useRoute } from 'vitepress'\r\n\r\nconst { frontmatter: fm } = useData()\r\nconst route = useRoute()\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003Cdiv>\r\n \u003Cimg class=\"rounded-t-xl\" :src=\"route.path + (fm.image || 'banner.jpg')\">\r\n \u003C/div>\r\n\u003C/template>\r\n```\r\n`.vitepress/theme/index.js` (simplified for this example)\r\n\r\n```js\r\nimport VPDocHeader from '../components/VPDocHeader.vue'\r\nexport default {\r\n Layout() {\r\n return h(DefaultTheme.Layout, null, {\r\n 'doc-before': () => h(VPDocHeader),\r\n })\r\n },\r\n}\r\n```\r\n\r\nWhen running this with `npm run dev` it is rendered out like this\r\n\r\n```html\r\n\u003Cimg class=\"rounded-t-xl\" src=\"/articles/001-vitepress-as-a-blog/banner.jpg\">\r\n```\n\n### Expected behavior\n\nI would expect VitePress to copy this to to assets etc when building\n\n### System Info\n\n```Text\nLinux EndeavourOS\r\nVitePress 1.0.1\r\nNodeJs 21.7.1\n```\n\n\n### Additional context\n\nI know I can probably solve this by rewriting to use `public/` ..but I would rather keep the images where the markdown files are.\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.",[2957],{"name":2903,"color":2904},3700,"Images from custom components are not working when running build","2024-04-28T12:25:27Z","https://github.com/vuejs/vitepress/issues/3700",0.76363355,{"description":2964,"labels":2965,"number":2971,"owner":2877,"repository":2878,"state":2906,"title":2972,"updated_at":2973,"url":2974,"score":2975},"### Describe the bug\n\nwhen i make an obvious mistake in `[hello].paths.js` as a counterpart to the `[hello].md` dynamic route files, i just see a generic error message.\r\n\r\ni want vitepress to _actually show me an error message_ lol not just this generic message\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-32ue1q?file=docs%2F[hello].paths.js\r\n\r\n```js\r\n// [hello].paths.js\r\nimport { iDontExist } from 'node:silly';\r\n\r\nexport default {\r\n async paths() {},\r\n};\r\n```\n\n### Expected behavior\n\ni expect an error to be printed to the console similar to what happens if you do `node docs/[hello].paths.js`\r\n\r\n```js\r\nError [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:silly\r\n at __node_internal_ (https://vite32ue1q-hour.w-credentialless.staticblitz.com/blitz.09144545.js:36:5410)\r\n at new \u003Canonymous> (https://vite32ue1q-hour.w-credentialless.staticblitz.com/blitz.09144545.js:36:4172)\r\n at ESMLoader.\u003Canonymous> (https://vite32ue1q-hour.w-credentialless.staticblitz.com/blitz.09144545.js:189:3457)\r\n at ESMLoader.\u003Canonymous> (https://vite32ue1q-hour.w-credentialless.staticblitz.com/blitz.09144545.js:248:8318) {\r\n code: 'ERR_UNKNOWN_BUILTIN_MODULE'\r\n}\r\n```\n\n### System Info\n\n```Text\nSystem:\r\n OS: Linux 5.0 undefined\r\n CPU: (4) 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 pnpm: 8.9.2 - /usr/local/bin/pnpm\r\n npmPackages:\r\n vitepress: latest => 1.0.0-rc.24\n```\n\n\n### Additional context\n\n\r\nnot very helpful 😢\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.",[2966,2967,2970],{"name":2868,"color":2869},{"name":2968,"color":2969},"contribution welcome","11E4B8",{"name":2871,"color":2872},3149,"`[hello].paths.js` swallows error","2024-01-07T00:05:00Z","https://github.com/vuejs/vitepress/issues/3149",0.7654611,["Reactive",2977],{},["Set"],["ShallowReactive",2980],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fXrU0JRliGoHDFDok0ygT2hjinyB9nXjkAkZT-qIOwNw":-1},"/vuejs/vitepress/1073"]