\r\n\u003C/template>\r\n\r\n\u003Cscript setup>\r\n// import { useRoute } from \"vitepress\";\r\n// const route = useRoute();\r\n\u003C/script>\r\n```\r\n\r\n3. Create `docs/.vitepress/theme/index.js` with the following contents:\r\n\r\n```js\r\nimport Layout from \"./Layout.vue\";\r\n\r\nexport default {\r\n Layout,\r\n};\r\n```\r\n\r\n4. Run `yarn docs:dev` and open http://localhost:3000. Note the heading doesn't have any styles applied to it:\r\n\r\n\r\n\r\n5. Uncomment the lines in the `\u003Cscript setup>` section in `docs/.vitepress/theme/Layout.vue`. Note the heading now has the default styles applied to it, even though we only imported `useRoute`:\r\n\r\n\r\n\r\n**Expected behavior**\r\nThe heading should remain unstyled since we aren't explicitly importing any styles.\r\n\r\n**System Info**\r\n- vitepress version: v0.9.2\r\n- vite version: v1.0.0-rc.13\r\n- Node version: v12.20.0\r\n- OS version: macOS Catalina 10.15.7\r\n\r\n**Additional context**\r\nI had a quick look at the Vitepress code and it looks like the problem might be to do with this line: https://github.com/vuejs/vitepress/blob/309aa7a8d0e7ab08c1c9db258c74709a66b295cb/src/client/app/exports.ts#L29\r\n\r\nAdding the following to `docs/.vitepress/config.js`:\r\n\r\n```javascript\r\nmodule.exports = {\r\n alias: {\r\n \"/@default-theme/index\": \"/@theme/empty.js\",\r\n },\r\n};\r\n```\r\n\r\n...and creating an empty file `docs/.vitepress/theme/empty.js` prevents the default styles being applied.\r\n",[],182,"Importing default composables also imports default theme's styles","2023-01-21T16:23:59Z","https://github.com/vuejs/vitepress/issues/182",0.6584789,{"description":2904,"labels":2905,"number":2906,"owner":2874,"repository":2875,"state":2876,"title":2907,"updated_at":2908,"url":2909,"score":2910},"\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.66006917,{"description":2912,"labels":2913,"number":2917,"owner":2874,"repository":2875,"state":2876,"title":2918,"updated_at":2919,"url":2920,"score":2921},"### Describe the bug\n\n项目中使用了 highlightjs 作为代码预览高亮工具。开发时并未发现异常,但是在构建时提示错误\r\n```text\r\nbuild error:\r\n file:///C:/demo-code/vitepress-error/docs/.vitepress/.temp/app.js:7\r\nimport hljsVuePlugin from \"@highlightjs/vue-plugin\";\r\n ^^^^^^^^^^^^^\r\nSyntaxError: The requested module '@highlightjs/vue-plugin' does not provide an export named 'default'\r\n at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)\r\n at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (node:internal/modules/esm/loader:385:24)\r\n at async build (file:///C:/demo-code/vitepress-error/node_modules/.pnpm/vitepress@1.0.0-alpha.45/node_modules/vitepress/dist/node/serve-ebe7f464.js:42286:24)\r\n ELIFECYCLE Command failed with exit code 1.\r\n```\r\n一开始我怀疑是该库存在问题,但是在常规 vue 应用中使用并构建都是没问题的。\n\n### Reproduction\n\n最小复现\r\n```text\r\nhttps://github.com/SaberA1ter/vitepress-error-demo\r\n```\r\n组件在 ```docs/.vitepress/theme/index.js``` 中注册,报错也是发生于此\n\n### Expected behavior\n\n开发正常,但是构建报错。\n\n### System Info\n\n```shell\nwin11\r\n\r\nnodejs: v16.15.1\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.",[2914],{"name":2915,"color":2916},"bug: pending triage","e99695",1905,"build 报错: SyntaxError: The requested module '@highlightjs/vue-plugin' does not provide an export named 'default'","2023-02-17T00:04:39Z","https://github.com/vuejs/vitepress/issues/1905",0.6602605,{"description":2923,"labels":2924,"number":2926,"owner":2874,"repository":2875,"state":2876,"title":2927,"updated_at":2928,"url":2929,"score":2930},"### 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.",[2925],{"name":2915,"color":2916},1695,"Build Error: Cannot use import statement outside a module","2023-01-21T14:16:57Z","https://github.com/vuejs/vitepress/issues/1695",0.66474265,{"description":2932,"labels":2933,"number":2935,"owner":2874,"repository":2875,"state":2876,"title":2936,"updated_at":2937,"url":2938,"score":2939},"**Describe the bug**\r\n\r\nWhen using vitepress with vue v3.1, we are now running into a compilation error as some vitepress components are using `\u003Ctemplate functional>`\r\n\r\nThe related change in vue-next is https://github.com/vuejs/vue-next/commit/467076361a730b7925c88c572793c78637e05ca7\r\n\r\n**To Reproduce**\r\n\r\nSee [this PR in VTU](https://github.com/vuejs/vue-test-utils-next/pull/654) (that uses vitepress for the docs) that fails because of vitepress and vue 3.1 \r\n\r\nIt can easily be reproduced in the current codebase by bumping vue to v3.1 and run `yarn docs-build`:\r\n\r\n```\r\nSyntaxError: \u003Ctemplate functional> is no longer supported in Vue 3, since functional components no longer have significant performance difference from stateful ones. Just use a normal \u003Ctemplate> instead.\r\n at /Users/ced-pro/Code/vue/vitepress/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:196:37\r\n at Array.forEach (\u003Canonymous>)\r\n at parse (/Users/ced-pro/Code/vue/vitepress/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:182:18)\r\n at createDescriptor (/Users/ced-pro/Code/vue/vitepress/node_modules/@vitejs/plugin-vue/dist/index.js:4048:62)\r\n at transformMain (/Users/ced-pro/Code/vue/vitepress/node_modules/@vitejs/plugin-vue/dist/index.js:4344:32)\r\n at Object.transform (/Users/ced-pro/Code/vue/vitepress/node_modules/@vitejs/plugin-vue/dist/index.js:4665:16)\r\n at /Users/ced-pro/Code/vue/vitepress/node_modules/rollup/dist/shared/rollup.js:19875:25 {\r\n loc: {\r\n start: { column: 11, line: 1, offset: 10 },\r\n end: { column: 21, line: 1, offset: 20 },\r\n source: 'functional'\r\n },\r\n id: '/Users/ced-pro/Code/vue/vitepress/dist/client/theme-default/com\r\n```\r\n\r\n**Expected behavior**\r\nvitepress should properly compile with Vue v3.1\r\n\r\n**System Info**\r\n- vitepress version: 0.14\r\n- vite version: 2.3.4\r\n- Node version: 14.17\r\n- OS version: macOS\r\n",[2934],{"name":2915,"color":2916},311,"Functional templates errors with vue v3.1","2023-01-21T16:22:22Z","https://github.com/vuejs/vitepress/issues/311",0.6694546,{"description":2941,"labels":2942,"number":2944,"owner":2874,"repository":2875,"state":2876,"title":2945,"updated_at":2946,"url":2947,"score":2948},"### Describe the bug\n\nI want to use the vue component in vitepress. I have read the documentation on the official website, but when I do it, I encounter an error like this.\r\n```bash\r\n[plugin:vite:vue] Tags with side effect (\u003Cscript> and \u003Cstyle>) are ignored in client component templates.\r\n```\r\n\r\nI don't understand what I'm encountering, I just want to achieve the effect here in this vue document\r\n\r\n> https://cn.vuejs.org/guide/reusability/composables.html#vs-react-hooks\r\n\r\n\r\n\r\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-dn63jg?file=docs%2Fhooks%2FuseMouse.js,docs%2Fexample.md\n\n### Expected behavior\n\nThe documentation on the official website makes me understand the difficulty or the need for a better demo?\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 11 10.0.22631\r\n CPU: (20) x64 13th Gen Intel(R) CoreT i7-13800H\r\n Memory: 17.07 GB / 31.74 GB\r\n Binaries:\r\n Node: 20.11.0 - ~\\AppData\\Local\\pnpm\\node.EXE\r\n npm: 10.2.4 - ~\\AppData\\Local\\pnpm\\npm.CMD\r\n pnpm: 8.14.1 - ~\\AppData\\Local\\pnpm\\pnpm.EXE\r\n Browsers:\r\n Edge: Chromium (120.0.2210.133)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: 1.0.0-rc.39 => 1.0.0-rc.39\n```\n\n\n### Additional context\n\nPlease tell me the correct way to write it, thank you\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.",[2943],{"name":2915,"color":2916},3485,"Using vue to report errors in markdown","2024-01-29T00:04:28Z","https://github.com/vuejs/vitepress/issues/3485",0.6703278,{"description":2950,"labels":2951,"number":2953,"owner":2874,"repository":2875,"state":2876,"title":2954,"updated_at":2955,"url":2956,"score":2957},"### Describe the bug\n\nWhen I want to import, I find that it will report an error.\r\n\r\nI see that the document is imported in this way.\r\n\r\nIs there anything wrong?Why doesn't it happen when I import from vue?\r\n\r\n\r\n\n\n### Reproduction\n\nAfter I created the project based on the document, I only installed 'vitepress-theme-demoblock'.\r\nThese are my configurations:\r\n\r\n\r\nAnd then it happended.\n\n### Expected behavior\n\nI was about to import some custom objects in the demo, but I found that even useData cannot be imported.\n\n### System Info\n\n```shell\n[vitepress] Internal server error: Transform failed with 1 error:\r\nE:/Draculabo/min-vitepress/vitepress-starter/docs/components/test.md:22:7: ERROR: Unexpected \"{\"\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.",[2952],{"name":2915,"color":2916},1990,"Internal server error: Import error in the demo container.","2023-03-17T00:04:20Z","https://github.com/vuejs/vitepress/issues/1990",0.6714641,{"description":2959,"labels":2960,"number":2964,"owner":2874,"repository":2875,"state":2876,"title":2965,"updated_at":2966,"url":2967,"score":2968},"### Describe the bug\n\nuse yarn2 build docs\n\n### Reproduction\n\nyarn \r\n\r\nyarn add vitepress -D\r\nvitepress serve docs\n\n### Expected behavior\n\nbuild success\n\n### System Info\n\n```shell\n❯ node -v\r\nv16.13.2\r\n❯ npm -v\r\n8.4.1\r\n❯ yarn -v\r\n3.1.1\r\n\r\n\"vitepress\": \"^0.22.1\"\n```\n\n\n### Additional context\n\n\r\n\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.",[2961],{"name":2962,"color":2963},"docs","0075ca",531,"Your application tried to access vue, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound","2023-01-21T14:34:10Z","https://github.com/vuejs/vitepress/issues/531",0.67532253,["Reactive",2970],{},["Set"],["ShallowReactive",2973],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fsqeza2EIfGf8j0_Ap8dL3arwgmOIHRO-oTfAK9X4yNw":-1},"/vuejs/vitepress/2987"]