\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,"vuejs","vitepress","closed","Importing default composables also imports default theme's styles","2023-01-21T16:23:59Z","https://github.com/vuejs/vitepress/issues/182",0.68775624,{"description":2876,"labels":2877,"number":2881,"owner":2868,"repository":2869,"state":2870,"title":2882,"updated_at":2883,"url":2884,"score":2885},"### 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.",[2878],{"name":2879,"color":2880},"bug: pending triage","e99695",1695,"Build Error: Cannot use import statement outside a module","2023-01-21T14:16:57Z","https://github.com/vuejs/vitepress/issues/1695",0.68895906,{"description":2887,"labels":2888,"number":2889,"owner":2868,"repository":2869,"state":2870,"title":2890,"updated_at":2891,"url":2892,"score":2893},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\nA clear and concise description of what the bug is.\r\n* I keep getting `I keep getting [vite] Internal server error: The request url \"/path\" is outside of vite dev server root \"/path\". ` when doing `vitepress dev docs`, \r\n* i dont get that error on build and serve\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n* In order to reproduce that bug you can simply use that [repository](https://github.com/gwenf/vue3-vitepress-demo)\r\n\r\n**Expected behavior**\r\nA clear and concise description of what you expected to happen.\r\n\r\n**System Info**\r\n- vitepress version: 0.10.7 and \"^0.13.2\"\r\n- vite version:\r\n- Node version:\r\n- OS version:\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n\r\n\u003Cimg width=\"487\" alt=\"Screen Shot 2021-05-11 at 7 32 04 PM\" src=\"https://user-images.githubusercontent.com/57079606/117808548-98e2cd00-b28f-11eb-96ca-1c36502e4c8d.png\">\r\n\r\n",[],297,"I keep getting [vite] Internal server error: The request url \"/path\" is outside of vite dev server root \"/path\". when using vitepress","2023-01-21T14:32:59Z","https://github.com/vuejs/vitepress/issues/297",0.6895154,{"description":2895,"labels":2896,"number":2897,"owner":2868,"repository":2869,"state":2870,"title":2898,"updated_at":2899,"url":2900,"score":2901},"### Describe the bug\n\nWhen I import PrimeVue and configure it in the theme/index.ts file, I got a error:\r\n```\r\n4:34:33 PM [vitepress] Pre-transform error: Failed to resolve entry for package \"primevue\". The package may have incorrect main/module/exports specified in its package.json: Missing \".\" specifier in \"primevue\" package\r\n4:34:33 PM [vitepress] Internal server error: Failed to resolve entry for package \"primevue\". The package may have incorrect main/module/exports specified in its package.json: Missing \".\" specifier in \"primevue\" package\r\n Plugin: vite:import-analysis\r\n ```\n\n### Reproduction\n\nCreate a vitepress project theme with custom theme:\r\n```\r\npnpm add vitepress\r\npnpm vitepress init\r\n```\r\nchoose all default but the Theme section:\r\n```\r\n◆ Theme:\r\n│ ○ Default Theme (Out of the box, good-looking docs)\r\n│ ○ Default Theme + Customization\r\n│ ● Custom Theme\r\n```\r\nthen add the PrimeVue lib:\r\n```\r\npnpm add primevue @primevue/themes\r\n```\r\nuse it in the theme/index.ts\r\n```\r\n// theme/index.ts\r\nimport Layout from './Layout.vue'\r\nimport type { Theme } from 'vitepress'\r\nimport './style.css'\r\n\r\nimport PrimeVue from \"primevue\"\r\nimport Aura from \"@primevue/themes\"\r\n\r\nexport default {\r\n\tLayout,\r\n\tenhanceApp({ app, router, siteData }) {\r\n\t\t// ...\r\n\t\tapp.use(PrimeVue, {\r\n\t\t\ttheme: {\r\n\t\t\t\tpreset: Aura\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n} satisfies Theme\r\n```\r\nthen run `pnpm docs:dev`\r\n\n\n### Expected behavior\n\nIt should be running without any error, but i got a package error.\r\nIt seems like there's some problem with `vite:import-analysis`\r\n\n\n### System Info\n\n```Text\nI tested in Arch and Windows\r\n\r\n System:\r\n OS: Linux 5.15 Arch Linux\r\n CPU: (16) x64 AMD Ryzen 7 8845H w/ Radeon 780M Graphics\r\n Memory: 5.77 GB / 7.41 GB\r\n Container: Yes\r\n Shell: 5.9 - /usr/bin/zsh\r\n Binaries:\r\n Node: 22.8.0 - ~/.local/share/pnpm/node\r\n npm: 10.8.2 - ~/.local/share/pnpm/npm\r\n pnpm: 9.10.0 - ~/.local/share/pnpm/pnpm\r\n```\r\n\r\n```\r\n System:\r\n OS: Windows 11 10.0.22631\r\n CPU: (16) x64 AMD Ryzen 7 8845H w/ Radeon 780M Graphics\r\n Memory: 4.74 GB / 15.30 GB\r\n Binaries:\r\n Node: 20.17.0 - E:\\nodejs\\node.EXE\r\n npm: 10.8.2 - E:\\nodejs\\npm.CMD\r\n pnpm: 9.10.0 - ~\\AppData\\Local\\Microsoft\\WinGet\\Links\\pnpm.EXE\r\n Browsers:\r\n Edge: Chromium (127.0.2651.86)\r\n Internet Explorer: 11.0.22621.3527\r\n```\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.",[],4192,"error while integrate custom theme with PrimeVue","2024-09-21T04:43:12Z","https://github.com/vuejs/vitepress/issues/4192",0.6911237,{"description":2903,"labels":2904,"number":2906,"owner":2868,"repository":2869,"state":2870,"title":2907,"updated_at":2908,"url":2909,"score":2910},"### Describe the bug\n\nI'm using version 4.1.1. After seeing picked date unscathed by setting dateFormat=\"yy-mm-dd\" to DatePicker component, I imported the Calendar component without realizing it was from versoin 3.\r\nAfter hitting save file, the following error keeps popping up.\r\n\r\n> [vite] page reload src/main.js\r\n[vite] Pre-transform error: Missing \"./\" specifier in \"primevue\" package\r\n[vite] Internal server error: Missing \"./\" specifier in \"primevue\" package\n\n### Reproduction\n\n1. Add the Calendar component in the main.js file\r\n``` javascript\r\nimport { createApp } from 'vue'\r\nimport App from './App.vue'\r\nimport router from './router'\r\nimport './assets/main.css'\r\n\r\nimport PrimeVue from 'primevue/config'\r\nimport InputText from 'primevue/inputtext'\r\nimport Button from 'primevue/button'\r\nimport Lara from '@primevue/themes/lara'\r\nimport DatePicker from 'primevue/datepicker'\r\nimport Tabs from 'primevue/tabs'\r\nimport TabList from 'primevue/tablist'\r\nimport TabPanels from 'primevue/tabpanels'\r\nimport DataTable from 'primevue/datatable'\r\nimport Column from 'primevue/column'\r\nimport ToastService from 'primevue/'\r\nimport Calendar from 'primevue/calendar'\r\n// import 'primeicons/primeicons.css';\r\n\r\nconst app = createApp(App)\r\n\r\napp.use(router)\r\n\r\napp.use(PrimeVue, {\r\n theme: {\r\n preset: Lara,\r\n },\r\n})\r\napp.use(ToastService)\r\napp.component('InputText', InputText)\r\napp.component('Button', Button)\r\napp.component('Tabs', Tabs)\r\napp.component('TabList', TabList)\r\napp.component('TabPanels', TabPanels)\r\napp.component('DataTable', DataTable)\r\napp.component('Column', Column)\r\napp.component('DatePicker', DatePicker)\r\n\r\napp.component('Calendar', Calendar)\r\n\r\napp.mount('#app')\r\n\r\n```\r\n2. Hit Ctrl+s to save file\r\n3. The vite dev server hot updates\n\n### Expected behavior\n\nThe dev server should run as always. I tried restarting the dev server, reinstalling primevue module, none of which gets me luck.\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) Core(TM) i5-13500\r\n Memory: 24.36 GB / 47.75 GB\r\n Binaries:\r\n Node: 20.10.0 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 10.2.3 - C:\\Program Files\\nodejs\\npm.CMD\r\n pnpm: 8.12.1 - ~\\AppData\\Local\\pnpm\\pnpm.EXE\r\n Browsers:\r\n Edge: Chromium (127.0.2651.74)\r\n Internet Explorer: 11.0.22621.3527\n```\n\n\n### Additional context\n\nI checked everywhere in the project, and everything about Calendar is cleared thoroughly.\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.",[2905],{"name":2879,"color":2880},4306,"Error after importing Calendar from version 4","2024-11-01T04:43:44Z","https://github.com/vuejs/vitepress/issues/4306",0.6990231,{"description":2912,"labels":2913,"number":2914,"owner":2868,"repository":2869,"state":2870,"title":2915,"updated_at":2916,"url":2917,"score":2918},"\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.7000883,{"description":2920,"labels":2921,"number":2923,"owner":2868,"repository":2869,"state":2870,"title":2924,"updated_at":2925,"url":2926,"score":2927},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\nAfter running npx vitepress, I open the browser and load the address of http://localhost:3000, but I get a error.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\nPS D:\\桌面\\demo> npx vitepress\r\nvitepress v0.5.0\r\nvite v1.0.0-rc.4\r\nlistening at http://localhost:3000\r\n[vite] Failed to resolve module import \"vue/dist/vue.runtime.esm-bundler.js.0.0-rc.5@vuedist\u000bue.runtime.esm-bundler.js\". (imported by /@app/components/Debug.vue)\r\n\r\n**Expected behavior**\r\nGetting \"Hello Vitepress\" in browser.\r\n\r\n**System Info**\r\n- vitepress version: v0.5.0\r\n- vite version: v1.0.0-rc.4\r\n- Node version: 12.14.0\r\n- OS version:10.0.19041 暂缺 Build 19041\r\n\r\n**Additional context**\r\n尤大大,I am you big fan.\r\n",[2922],{"name":2879,"color":2880},65,"服务启动之后,进入地址报错","2023-01-21T16:25:36Z","https://github.com/vuejs/vitepress/issues/65",0.70096236,{"description":2929,"labels":2930,"number":2932,"owner":2868,"repository":2869,"state":2870,"title":2933,"updated_at":2934,"url":2935,"score":2936},"### Describe the bug\r\n\r\nWhen I try to run `vitepress build` I get:\r\n\r\n```\r\n[vite]: Rollup failed to resolve import \"vue/server-renderer\" from \"/Users/nick/Library/Mobile Documents/27N4MQEA55~pro~writer/Documents/Notes/Docs/index.md\".\r\nThis is most likely unintended because it can break your application at runtime.\r\nIf you do want to externalize this module explicitly add it to\r\n`build.rollupOptions.external`\r\n✖ building client + server bundles...\r\nbuild error:\r\nError: [vite]: Rollup failed to resolve import \"vue/server-renderer\" from \"/Users/nick/Library/Mobile Documents/27N4MQEA55~pro~writer/Documents/Notes/Docs/index.md\".\r\nThis is most likely unintended because it can break your application at runtime.\r\nIf you do want to externalize this module explicitly add it to\r\n`build.rollupOptions.external`\r\n at viteWarn (file:///Users/nick/Developer/PE/0023/vitepress/node_modules/.pnpm/vite@4.4.7_@types+node@20.4.5/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:48088:27)\r\n at onRollupWarning (file:///Users/nick/Developer/PE/0023/vitepress/node_modules/.pnpm/vite@4.4.7_@types+node@20.4.5/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:48120:9)\r\n at onwarn (file:///Users/nick/Developer/PE/0023/vitepress/node_modules/.pnpm/vite@4.4.7_@types+node@20.4.5/node_modules/vite/dist/node/chunks/dep-3b8eb186.js:47848:13)\r\n at file:///Users/nick/Developer/PE/0023/vitepress/node_modules/.pnpm/rollup@3.27.0/node_modules/rollup/dist/es/shared/node-entry.js:24090:13\r\n at Object.logger [as onLog] (file:///Users/nick/Developer/PE/0023/vitepress/node_modules/.pnpm/rollup@3.27.0/node_modules/rollup/dist/es/shared/node-entry.js:25762:9)\r\n at ModuleLoader.handleInvalidResolvedId (file:///Users/nick/Developer/PE/0023/vitepress/node_modules/.pnpm/rollup@3.27.0/node_modules/rollup/dist/es/shared/node-entry.js:24676:26)\r\n at file:///Users/nick/Developer/PE/0023/vitepress/node_modules/.pnpm/rollup@3.27.0/node_modules/rollup/dist/es/shared/node-entry.js:24636:26\r\n\r\n```\r\n\r\n### Reproduction\r\n\r\n1. Set `srcDir` parameter to some folder outside of the root project.\r\n2. Run `vitepress build`\r\n3. Get the error\r\n\r\n### Expected behavior\r\n\r\nNot getting the error during build while having `srcDir` set to a folder outside of the project root\r\n\r\n### System Info\r\n\r\n```sh\r\nSystem:\r\n OS: macOS 13.5\r\n CPU: (10) arm64 Apple M2 Pro\r\n Memory: 63.59 MB / 32.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.5.0 - /opt/homebrew/bin/node\r\n Yarn: 1.22.19 - /opt/homebrew/bin/yarn\r\n npm: 9.8.0 - /opt/homebrew/bin/npm\r\n pnpm: 8.6.10 - /opt/homebrew/bin/pnpm\r\n Browsers:\r\n Chrome: 115.0.5790.114\r\n Safari: 16.6\r\n Safari Technology Preview: 17.0\r\n npmPackages:\r\n vitepress: 1.0.0-beta.7 => 1.0.0-beta.7\r\n```\r\n\r\n\r\n### Additional context\r\n\r\nWhen I move src folder into the project root and point to it in `srcDir` it works properly.\r\n\r\nWhen I create a symlink in the project root and point `srcDir` to it I get the same error.\r\n\r\nIf I follow suggestions in the error message to set `build.rollupOptions.external` like this:\r\n```js\r\n vite: {\r\n build: {\r\n rollupOptions: {\r\n external: [\"vue/server-renderer\", \"vue\"]\r\n }\r\n }\r\n }\r\n```\r\nI get it to build successfully but then interactions (collapsed items in sidebar) won't work because it can't find vue.\r\n\r\nOverall my goal is to have vitepress project and markdown files completely separate from each other. \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.",[2931],{"name":2879,"color":2880},2713,"When building getting this error: Rollup failed to resolve import \"vue/server-renderer\" from \"...\"","2023-08-11T00:04:39Z","https://github.com/vuejs/vitepress/issues/2713",0.7042095,{"description":2938,"labels":2939,"number":2941,"owner":2868,"repository":2869,"state":2870,"title":2942,"updated_at":2943,"url":2944,"score":2945},"### Describe the bug\n\nAn error occurred while building with `vitepress@1.0.0-alpha.13` (`vite@3.1.0`) and `ant-design-vue` **(dev working!)**\r\n> SyntaxError: Cannot use import statement outside a module\r\n\r\n\r\n\n\n### Reproduction\n\n# Steps:\r\n1. create a new project\r\n2. register a custom component `custom-button`\r\n3. use the `custom-button` in `index.md`\r\n4. building with vitepress\r\n\r\nReproduction repo: \r\nhttps://github.com/yeojongki/vitepress-cannot-use-import-statement-outside-a-module `(cd docs && pnpm i && pnpm build)`\r\n\n\n### Expected behavior\n\nsuccess build\n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.19044\r\n CPU: (8) x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz\r\n Memory: 12.70 GB / 31.97 GB\r\n Binaries:\r\n Node: 16.13.0 - E:\\nodejs\\node.EXE\r\n Yarn: 1.22.17 - E:\\nodejs\\yarn.CMD\r\n npm: 8.1.3 - E:\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.27)\r\n Internet Explorer: 11.0.19041.1566\r\n npmPackages:\r\n vitepress: 1.0.0-alpha.13 => 1.0.0-alpha.13\n```\n\n\n### Additional context\n\nrelative issue https://github.com/vuejs/vitepress/issues/324, but closed\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.",[2940],{"name":2879,"color":2880},1329,"SyntaxError: Cannot use import statement outside a module","2023-01-21T14:25:25Z","https://github.com/vuejs/vitepress/issues/1329",0.7047487,{"description":2947,"labels":2948,"number":2952,"owner":2868,"repository":2869,"state":2870,"title":2953,"updated_at":2954,"url":2955,"score":2956},"### Describe the bug\n\nI'm trying to migrate my documentation from a regular Vite setup to Vitepress.\r\nEverything works fine when using `vitepress dev` (except that the CSS is sometimes broken upon first load).\r\nHowever, `vitepress build` fails with the following output:\r\n\r\n```\r\n$ vitepress build docs\r\nvitepress v0.20.9\r\n✓ building client + server bundles...\r\n- rendering pages...\r\nError [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/d3/src/index.js from /home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/demo_index.md.js not supported.\r\nInstead change the require of index.js in /home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/demo_index.md.js to a dynamic import() which is available in all CommonJS modules.\r\n at Module.\u003Canonymous> (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/demo_index.md.js:25:10)\r\n at /home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:1621:12\r\n at loadPage (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:163:18)\r\n at Object.go (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:156:12)\r\n at renderPage (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/node/serve-61783397.js:40037:10)\r\n at Object.build (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/node/serve-61783397.js:40169:15) {\r\n code: 'ERR_REQUIRE_ESM'\r\n}\r\n✖ rendering pages...\r\nbuild error:\r\n TypeError: Cannot read properties of null (reading 'frontmatter')\r\n at ReactiveEffect.fn (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:91:48)\r\n at ReactiveEffect.run (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:153:29)\r\n at ComputedRefImpl.get value [as value] (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:1010:39)\r\n at ReactiveEffect.fn (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:1259:23)\r\n at ReactiveEffect.run (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:153:29)\r\n at ComputedRefImpl.get value [as value] (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:1010:39)\r\n at ReactiveEffect.fn (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/vitepress/dist/client/app/temp/app.js:1279:36)\r\n at ReactiveEffect.run (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:153:29)\r\n at ComputedRefImpl.get value [as value] (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:1010:39)\r\n at Object.unref (/home/runner/work/d3-graph-controller/d3-graph-controller/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js:923:29)\r\nerror Command failed with exit code 1.\r\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\r\n```\n\n### Reproduction\n\n1. Use d3 as a dependency.\r\n2. Run `vitepress build`\n\n### Expected behavior\n\nThe build passes.\n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.22000\r\n CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor \r\n Memory: 14.80 GB / 31.92 GB\r\n Binaries:\r\n Node: 16.13.0 - C:\\Program Files\\nodejs\\node.EXE\r\n Yarn: 1.22.15 - ~\\AppData\\Roaming\\npm\\yarn.CMD\r\n npm: 7.20.3 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22000.120.0), Chromium (96.0.1054.62)\r\n Internet Explorer: 11.0.22000.120\r\n npmPackages:\r\n vitepress: 0.20.9 => 0.20.9\n```\n\n\n### Additional context\n\nA reproducing repository is available at https://github.com/DerYeger/d3-graph-controller and a log of the error can be found at https://github.com/DerYeger/d3-graph-controller/runs/4618930216?check_suite_focus=true.\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.",[2949],{"name":2950,"color":2951},"build","377ba8",476,"`vitepress build` fails with `ERR_REQUIRE_ESM`","2023-01-21T14:25:31Z","https://github.com/vuejs/vitepress/issues/476",0.7072119,["Reactive",2958],{},["Set"],["ShallowReactive",2961],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f3Mt810ZEFv2QquXvBsb94VdlZ038t_5yIot8dgteLaw":-1},"/vuejs/vitepress/2692"]