\r\n\u003C/template>\r\n\r\n```\r\n\r\n- `index.md`:\r\n\r\n```md\r\n---\r\nlayout: home\r\n---\r\n\r\n\u003Cscript setup>\r\nimport { useData } from 'vitepress'\r\n\u003C/script>\r\n\r\n{{ useData() }}\r\n```\r\n\r\nSee \u003Chttps://stackblitz.com/edit/vite-x3jrgk>.\n\n### Expected behavior\n\nThere should be no such warning.\n\n### System Info\n\n```sh\nSystem:\r\n OS: macOS 13.5\r\n CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz\r\n Memory: 224.85 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.5.1 - /usr/local/bin/node\r\n npm: 9.8.0 - /usr/local/bin/npm\r\n pnpm: 8.6.6 - /usr/local/bin/pnpm\r\n Browsers:\r\n Chrome: 116.0.5845.110\r\n Edge: 115.0.1901.188\r\n Safari: 16.6\r\n npmPackages:\r\n vitepress: 1.0.0-rc.4 => 1.0.0-rc.4\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.",[2913],{"name":2868,"color":2869},2856,"Imports from vitepress in markdown files lead to reexport warning","2023-09-03T00:04:43Z","https://github.com/vuejs/vitepress/issues/2856",0.68793774,{"description":2920,"labels":2921,"number":2925,"owner":2874,"repository":2875,"state":2876,"title":2926,"updated_at":2927,"url":2928,"score":2929},"### Describe the bug\n\n当我使用vitepress打包时,报错:\r\n$ vitepress build docs\r\n\r\n vitepress v1.0.0-rc.40\r\n\r\n⠏ building client + server bundles...\r\n(!) Some chunks are larger than 500 kB after minification. Consider:\r\n- Using dynamic import() to code-split the application\r\n- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks\r\n- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.\r\n[commonjs--resolver] Missing \"./server-renderer\" specifier in \"vue\" package\r\n✖ building client + server bundles...\r\nbuild error:\r\nError: Missing \"./server-renderer\" specifier in \"vue\" package\r\n at e (file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:21914:25)\r\n at n (file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:21914:627)\r\n at o (file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:21914:1297)\r\n at resolveExportsOrImports (file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:29466:20)\r\n at resolveDeepImport (file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:29485:31)\r\n at tryNodeResolve (file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:29210:20)\r\n at Object.resolveId (file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:28978:28)\r\n at Object.handler (file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:67383:19)\r\n at file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/rollup/dist/es/shared/node-entry.js:18642:40 \r\n at async PluginDriver.hookFirstAndGetPlugin (file:///E:/code/vesyncUI/node_modules/vitepress/node_modules/rollup/dist/es/shared/node-entry.js:18542:28)\r\nerror Command failed with exit code 1.\r\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n\n### Reproduction\n\nyarn docs:build\n\n### Expected behavior\n\n打包完成\n\n### System Info\n\n```Text\nnode: 18.19.0\r\nvitepress:v1.0.0-rc.40\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.",[2922],{"name":2923,"color":2924},"need more info","bdbefc",3492,"vitepress打包报错","2024-02-21T00:04:28Z","https://github.com/vuejs/vitepress/issues/3492",0.6893706,{"description":2931,"labels":2932,"number":2934,"owner":2874,"repository":2875,"state":2876,"title":2935,"updated_at":2936,"url":2937,"score":2938},"### Describe the bug\n\nall auto import components in dev mode is ok.\nall auto import components in build mode is ok, when there have no 'script' tag in md files\n\nif md file have 'script' tag of one page. the page's auto import component will not resolve in **build mode**!!!!\n\n### Reproduction\n\nit's an empty vitepress project.\n\n[Reproduction URL](https://github.com/huchaomin/vitepress-auto-import-bug)\n\n### Expected behavior\n\n\u003Cimg width=\"900\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/76a803ce-949b-4ae2-b229-32484d930cde\" />\n\n\u003Cimg width=\"821\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/d4b60aea-4b7c-422f-8c0e-339be12dbe42\" />\n\n\u003Cimg width=\"901\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/691bb9b3-a61d-4f15-8426-68416f7340da\" />\n\n\u003Cimg width=\"915\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/9c8470cc-7c45-476a-aaf1-3f990a1c57f0\" />\n\n### System Info\n\n```Text\nSystem:\n OS: Windows 11 10.0.22631\n CPU: (28) x64 Intel(R) Core(TM) i7-14700KF\n Memory: 15.99 GB / 31.82 GB\n Binaries:\n Node: 20.17.0 - D:\\Program Files\\nodejs\\node.EXE\n npm: 10.8.2 - D:\\Program Files\\nodejs\\npm.CMD\n pnpm: 9.8.0 - D:\\Program Files\\nodejs\\pnpm.CMD\n Browsers:\n Edge: Chromium (127.0.2651.74)\n Internet Explorer: 11.0.22621.3527\n npmPackages:\n vitepress: ^1.6.3 => 1.6.3\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.",[2933],{"name":2868,"color":2869},4519,"\"vitepress\" work with \"unplugin-vue-components\" bug","2025-02-02T04:41:47Z","https://github.com/vuejs/vitepress/issues/4519",0.69244456,{"description":2940,"labels":2941,"number":2942,"owner":2874,"repository":2875,"state":2876,"title":2943,"updated_at":2944,"url":2945,"score":2946},"\r\n**Describe the bug**\r\nvitepress dev docs working but vitepress build docs has errors.\r\n\r\n```\r\n> vitepress dev docs\r\n\r\nvitepress v0.15.3\r\nvite v2.3.7\r\nD:\\vue3-openlayers\\docs\\.vitepress\\config.js\r\n\r\n vite v2.3.7 dev server running at:\r\n\r\n > Local: http://localhost:3000/\r\n > Network: use `--host` to expose\r\n[@vue/compiler-sfc] \u003Cscript setup> is still an experimental proposal.\r\nFollow its status at https://github.com/vuejs/rfcs/pull/227.\r\n\r\n[@vue/compiler-sfc] When using experimental features,\r\nit is recommended to pin your vue dependencies to exact versions to avoid breakage.\r\n```\r\n\r\n```\r\n> vitepress build docs\r\n\r\nvitepress v0.15.3\r\nvite v2.3.7\r\n⠧ building client + server bundles...\r\n(!) Some chunks are larger than 500kb after minification. Consider:\r\n- Using dynamic import() to code-split the application\r\n- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks\r\n- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.\r\n✓ building client + server bundles...\r\n✖ rendering pages...\r\nbuild error:\r\n D:\\vue3-openlayers\\node_modules\\ol\\Map.js:17\r\nimport CompositeMapRenderer from './renderer/Composite.js';\r\n^^^^^^\r\n\r\nSyntaxError: Cannot use import statement outside a module\r\n at wrapSafe (internal/modules/cjs/loader.js:1001:16)\r\n at Module._compile (internal/modules/cjs/loader.js:1049:27)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)\r\n at Module.load (internal/modules/cjs/loader.js:950:32)\r\n at Function.Module._load (internal/modules/cjs/loader.js:791:14)\r\n at Module.require (internal/modules/cjs/loader.js:974:19)\r\n at require (internal/modules/cjs/helpers.js:88:18)\r\n at Module.\u003Canonymous> (D:\\vue3-openlayers\\node_modules\\vitepress\\dist\\client\\app\\temp\\app.js:25:13)\r\n at Module._compile (internal/modules/cjs/loader.js:1085:30)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! errno 1\r\nnpm ERR! vue3-openlayers@0.1.0 docs:build: `vitepress build docs`\r\nnpm ERR! Exit status 1\r\n```\r\n\r\n**Expected behavior**\r\n\r\nsuccess build\r\n\r\n**System Info**\r\n- vitepress version: ^0.15.3\r\n- vite version: 2.3.7\r\n- Node version: v14.13.0\r\n- OS version: win 10\r\n\r\n",[],324,"dev works but build not (Cannot use import statement outside a module)","2023-01-21T14:28:40Z","https://github.com/vuejs/vitepress/issues/324",0.6952775,{"description":2948,"labels":2949,"number":2951,"owner":2874,"repository":2875,"state":2876,"title":2952,"updated_at":2953,"url":2954,"score":2955},"### Describe the bug\n\nWe use VitePress to build a demo website for a component library. To allow the Vue browser tools to work on this demo website, we would like to build and publish the website in production mode.\r\n\r\nI thought that adding `mode: 'development'` to our `vite.config.ts` would accomplish this, but it throws errors like this when building:\r\n```\r\n⠦ rendering pages...Error: Cannot find module '/introduction/usage.md?t=1649205963799'\r\nRequire stack:\r\n- /home/catrope/git/codex/packages/codex-docs/docs/.vitepress/.temp/app.js\r\n- /home/catrope/git/codex/packages/codex-docs/node_modules/vitepress/dist/node/serve-9874c5ac.js\r\n- /home/catrope/git/codex/packages/codex-docs/node_modules/vitepress/dist/node/cli.js\r\n- /home/catrope/git/codex/packages/codex-docs/node_modules/vitepress/bin/vitepress.js\r\n at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)\r\n at Function.Module._load (node:internal/modules/cjs/loader:778:27)\r\n at Module.require (node:internal/modules/cjs/loader:1005:19)\r\n at require (node:internal/modules/cjs/helpers:94:18)\r\n at /home/catrope/git/codex/packages/codex-docs/docs/.vitepress/.temp/app.js:2098:12\r\n at loadPage (/home/catrope/git/codex/packages/codex-docs/docs/.vitepress/.temp/app.js:185:18)\r\n at Object.go (/home/catrope/git/codex/packages/codex-docs/docs/.vitepress/.temp/app.js:178:12)\r\n at renderPage (/home/catrope/git/codex/packages/codex-docs/node_modules/vitepress/dist/node/serve-9874c5ac.js:40217:10)\r\n at Object.build (/home/catrope/git/codex/packages/codex-docs/node_modules/vitepress/dist/node/serve-9874c5ac.js:40362:15) {\r\n code: 'MODULE_NOT_FOUND',\r\n requireStack: [\r\n '/home/catrope/git/codex/packages/codex-docs/docs/.vitepress/.temp/app.js',\r\n '/home/catrope/git/codex/packages/codex-docs/node_modules/vitepress/dist/node/serve-9874c5ac.js',\r\n '/home/catrope/git/codex/packages/codex-docs/node_modules/vitepress/dist/node/cli.js',\r\n '/home/catrope/git/codex/packages/codex-docs/node_modules/vitepress/bin/vitepress.js'\r\n ]\r\n}\r\n```\r\nThis error repeats for every Markdown file. The build then says it has succeeded, and it does produce a directory structure with HTML files, but all of them contain a 404 error page.\r\n\r\nI also tried adding `vue: { isProduction: false }` to the VitePress config, but that doesn't appear to make the development tools work.\n\n### Reproduction\n\n- In `docs/vite.config.ts`,add `mode: 'development'` at the top level (our full Vite config is [here](https://github.com/wikimedia/design-codex/blob/main/packages/codex-docs/docs/vite.config.ts))\r\n- Run `vitepress build docs`\r\n- Lots of errors are thrown, and a build is generated that contains only 404 pages\n\n### Expected behavior\n\nA static site is built that has the correct content in it (not just 404 pages), and that uses the development build of Vue rather than the production build. At minimum, enabling development mode shouldn't blow everything up.\n\n### System Info\n\n```shell\nSystem:\r\n OS: Linux 5.4 Ubuntu 20.04.4 LTS (Focal Fossa)\r\n CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz\r\n Memory: 1.89 GB / 15.39 GB\r\n Container: Yes\r\n Shell: 5.0.17 - /bin/bash\r\n Binaries:\r\n Node: 16.9.1 - ~/.nvm/versions/node/v16.9.1/bin/node\r\n Yarn: 1.22.11 - ~/.nvm/versions/node/v16.9.1/bin/yarn\r\n npm: 8.5.3 - ~/.nvm/versions/node/v16.9.1/bin/npm\r\n Browsers:\r\n Chrome: 100.0.4896.75\r\n Chromium: 100.0.4896.60\r\n Firefox: 98.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.",[2950],{"name":2868,"color":2869},598,"Building with `mode: 'development'` throws errors, generates all pages as 404s","2023-01-21T16:04:31Z","https://github.com/vuejs/vitepress/issues/598",0.69813156,{"description":2957,"labels":2958,"number":2960,"owner":2874,"repository":2875,"state":2876,"title":2961,"updated_at":2962,"url":2963,"score":2964},"### Describe the bug\r\n\r\nIt show error when I run `pnpm build`\r\n\r\n### Reproduction\r\n\r\n- vite config:\r\n```\r\nvite: {\r\n server: {\r\n // target: 'webworker',\r\n host: true,\r\n port: 3001,\r\n fs: {\r\n // for when developing with locally linked theme\r\n allow: ['../..']\r\n }\r\n },\r\n build: {\r\n // minify: 'terser',\r\n chunkSizeWarningLimit: Infinity\r\n },\r\n json: {\r\n stringify: true\r\n },\r\n ssr: {\r\n format: 'cjs',\r\n noExternal: []\r\n },\r\n legacy: {\r\n buildSsrCjsExternalHeuristics: true\r\n },\r\n plugins: [\r\n vueJsx(),\r\n SearchPlugin({\r\n tokenize: 'full'\r\n })\r\n ],\r\n css: {\r\n preprocessorOptions: {\r\n less: {\r\n javascriptEnabled: true\r\n }\r\n }\r\n }\r\n },\r\n\r\n vue: {\r\n reactivityTransform: true\r\n }\r\n```\r\n\r\n\r\n- build error:\r\n\r\n```\r\nbuild error:\r\n /Users/bou/working/code/practice/sinogear-frontend-component-vue/docs/node_modules/.pnpm/ant-design-vue@3.2.15_vue@3.2.45/node_modules/ant-design-vue/es/locale/zh_CN.js:2\r\nimport Pagination from '../vc-pagination/locale/zh_CN';\r\n^^^^^^\r\n\r\nSyntaxError: Cannot use import statement outside a module\r\n```\r\n\r\n### Expected behavior\r\n\r\nbuild successful\r\n\r\n### System Info\r\n\r\n```shell\r\n\"ant-design-vue\": \"^3.2.10\",\r\n \"@vue/theme\": \"^1.2.2\",\r\n \"vue\": \"^3.2.37\",\r\n \"vitepress\": \"^1.0.0-alpha.31\",\r\n \"vitepress-plugin-search\": \"1.0.4-alpha.15\",\r\n \"vitepress-theme-demoblock\": \"^2.0.0\"\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.vuejs.org).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2959],{"name":2868,"color":2869},1695,"Build Error: Cannot use import statement outside a module","2023-01-21T14:16:57Z","https://github.com/vuejs/vitepress/issues/1695",0.69813776,["Reactive",2966],{},["Set"],["ShallowReactive",2969],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f8u_H_lNiI-EyzVFaRz6BDDr3ValYgcSuC0DlHSsij-8":-1},"/vuejs/vitepress/4770"]