\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.",[3033],{"name":3020,"color":3021},4519,"\"vitepress\" work with \"unplugin-vue-components\" bug","2025-02-02T04:41:47Z","https://github.com/vuejs/vitepress/issues/4519",0.641697,{"description":3040,"labels":3041,"number":3043,"owner":3023,"repository":3024,"state":3025,"title":3044,"updated_at":3045,"url":3046,"score":3047},"### Describe the bug\n\nupdate \"vitepress\": \"^1.0.0-alpha.6\"\r\nin theme index.js\r\nimport naive from 'naive-ui'\r\n enhanceApp({ app }) {\r\n app.use(naive)\r\n }\r\n\r\nnpm run docs:build\r\n\r\n✓ building client + server bundles...\r\n(node:31512) Warning: To load an ES module, set \"type\": \"module\" in the package.json or use the .mjs extension.\r\n(Use `node --trace-warnings ...` to show where the warning was created)\r\nbuild error:\r\n C:\\Users\\A0\\Documents\\vitePress\\node_modules\\naive-ui\\es\\index.js:1\r\nexport { default, install } from './preset';\r\n^^^^^^\r\n\r\nSyntaxError: Unexpected token 'export'\r\n at wrapSafe (node:internal/modules/cjs/loader:1032:15)\r\n at Module._compile (node:internal/modules/cjs/loader:1067:27)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)\r\n at Module.load (node:internal/modules/cjs/loader:981:32)\r\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\r\n at ModuleWrap.\u003Canonymous> (node:internal/modules/esm/translators:168:29)\r\n at ModuleJob.run (node:internal/modules/esm/module_job:197:25)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (node:internal/modules/esm/loader:337:24)\r\n\r\n\n\n### Reproduction\n\nnpm run docs:build\n\n### Expected behavior\n\ntheme Full Import naive-ui \r\nbuild success\n\n### System Info\n\n```shell\n\"vitepress\": \"^1.0.0-alpha.6\"\r\n node : 14.16.2\r\n browsers : chrome\r\n system windows\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.",[3042],{"name":3020,"color":3021},1399,"import naive from 'naive-ui' build error: export { default, install } from './preset'; ^^^^^^ SyntaxError: Unexpected token 'export'","2023-01-21T14:25:25Z","https://github.com/vuejs/vitepress/issues/1399",0.6439258,{"description":3049,"labels":3050,"number":3052,"owner":3023,"repository":3024,"state":3025,"title":3053,"updated_at":3054,"url":3055,"score":3056},"### Describe the bug\n\nFor some reason vitepress's module resolution doesn't pick up re-exported things in esm modules. This may affect more than just the dependency I'm having problems with, but in this case it's @popperjs/core aka. [floating ui](https://github.com/floating-ui/floating-ui) - when importing their constant `placements` `vitepress build` throws the following error:\r\n\r\n```\r\nvitepress v1.0.0-beta.1\r\n\r\n✓ building client + server bundles...\r\n⠋ rendering pages...(node:238582) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time\r\n(Use `node --trace-warnings ...` to show where the warning was created)\r\nfile:///xxx/.vitepress/.temp/markdown-examples.md.js:3\r\nimport { createPopper, placements } from \"@popperjs/core\";\r\n ^^^^^^^^^^\r\nSyntaxError: Named export 'placements' not found. The requested module '@popperjs/core' is a CommonJS module, which may not support all module.exports as named exports.\r\nCommonJS modules can always be imported via the default export, for example using:\r\n\r\nimport pkg from '@popperjs/core';\r\nconst { createPopper, placements } = pkg;\r\n\r\n at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)\r\n at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (node:internal/modules/esm/loader:530:24)\r\n at async loadPage (file:///xxx/.vitepress/.temp/Content.2e4fdb81.js:210:18)\r\n at async Object.go (file:///xxx/.vitepress/.temp/Content.2e4fdb81.js:202:5)\r\n at async render (file:///xxx/.vitepress/.temp/app.js:4561:3)\r\n at async renderPage (file:///xxx/node_modules/vitepress/dist/node/serve-d5608de4.js:41246:19)\r\n at async Promise.all (index 3)\r\n at async build (file:///xxx/node_modules/vitepress/dist/node/serve-d5608de4.js:41781:7)\r\n✖ rendering pages...\r\nbuild error:\r\nfile:///xxx/.vitepress/.temp/markdown-examples.md.js:3\r\nimport { createPopper, placements } from \"@popperjs/core\";\r\n ^^^^^^^^^^\r\nSyntaxError: Named export 'placements' not found. The requested module '@popperjs/core' is a CommonJS module, which may not support all module.exports as named exports.\r\nCommonJS modules can always be imported via the default export, for example using:\r\n\r\nimport pkg from '@popperjs/core';\r\nconst { createPopper, placements } = pkg;\r\n\r\n at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)\r\n at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (node:internal/modules/esm/loader:530:24)\r\n at async loadPage (file:///xxx/.vitepress/.temp/Content.2e4fdb81.js:210:18)\r\n at async Object.go (file:///xxx/.vitepress/.temp/Content.2e4fdb81.js:202:5)\r\n at async render (file:///xxx/.vitepress/.temp/app.js:4561:3)\r\n at async renderPage (file:///xxx/node_modules/vitepress/dist/node/serve-d5608de4.js:41246:19)\r\n at async Promise.all (index 3)\r\n at async build (file:///xxx/node_modules/vitepress/dist/node/serve-d5608de4.js:41781:7)\r\n\r\nProcess finished with exit code 1\r\n```\r\n\r\nThe dependency is not marked as \"native\" esm module (via `\"type\": \"module\"` in the `package.json`) but provides both cjs, esm and umd bundles. \r\n\r\nThe import path looks like the following: `@popperjs/core -> @popperjs/core/dist/esm/index.js -> @popperjs/core/dist/esm/enums.js `, you can check it out in the `node_modules` folder.\n\n### Reproduction\n\nReproduced [here](https://stackblitz.com/edit/vite-k6uusu?file=package.json,docs%2Fexample.md), in actuality this is a dependency of another dependency, where it wasn't possible to import it if `\"type\": \"module\"` wasn't specified in the `package.json`. So it seems like there is a problem with esm modules that support esm, but don't have `\"type\": \"module\"` set in their `package.json`.\n\n### Expected behavior\n\nIt should import the constant correctly.\n\n### System Info\n\n```sh\nSystem:\r\n OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)\r\n CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics\r\n Memory: 4.73 GB / 31.22 GB\r\n Container: Yes\r\n Shell: 5.1.16 - /bin/bash\r\n Binaries:\r\n Node: 18.12.1 - /usr/local/bin/node\r\n npm: 9.6.6 - /usr/local/bin/npm\r\n Browsers:\r\n Chrome: 113.0.5672.126\r\n npmPackages:\r\n vitepress: ^1.0.0-beta.1 => 1.0.0-beta.1\n```\n\n\n### Additional context\n\nMaybe related to #1232 and [#10822](https://github.com/nuxt/nuxt/discussions/10822)\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.",[3051],{"name":3020,"color":3021},2411,"Build fails because a requested module is a CommonJS module, even though it's not (kinda)","2023-06-02T00:04:14Z","https://github.com/vuejs/vitepress/issues/2411",0.65080905,{"description":3058,"labels":3059,"number":3063,"owner":3023,"repository":3024,"state":3025,"title":3064,"updated_at":3065,"url":3066,"score":3067},"### Describe the bug\n\n在learn中通过 yarn add --dev vitepress 安装并配置后,在运行时报错:\r\n1、(node:20568) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time\r\n(Use `node --trace-warnings ...` to show where the warning was created)\r\n2、[ERROR] No matching export in \"node_modules/vitepress/node_modules/vue/dist/vue.runtime.esm-bundler.js\" for import \"default\"\r\n3、[ERROR] No matching export in \"node_modules/vue-demi/lib/index.mjs\" for import \"set\"\n\n### Reproduction\n\n使用的vitepress版本号为:^1.0.0-rc.39\n\n### Expected behavior\n\n运行命令:yarn docs:dev\n\n### System Info\n\n```Text\n\"lerna\": \"^5.5.0\",\r\n\"vitepress\": \"^1.0.0-rc.39\"\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.",[3060],{"name":3061,"color":3062},"need more info","bdbefc",3487,"运行项目时失败","2024-02-01T00:05:22Z","https://github.com/vuejs/vitepress/issues/3487",0.6548327,{"description":3069,"labels":3070,"number":3072,"owner":3023,"repository":3024,"state":3025,"title":3073,"updated_at":3045,"url":3074,"score":3075},"### 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.",[3071],{"name":3020,"color":3021},1329,"SyntaxError: Cannot use import statement outside a module","https://github.com/vuejs/vitepress/issues/1329",0.65487593,{"description":3077,"labels":3078,"number":3080,"owner":3023,"repository":3024,"state":3025,"title":3081,"updated_at":3082,"url":3083,"score":3084},"### Describe the bug\n\n```\r\n▶ yarn build:docs\r\nyarn run v1.22.10\r\n$ vitepress build docs\r\nvitepress v0.15.6\r\nvite v2.4.1\r\n✓ building client + server bundles...\r\n⠋ rendering pages...\r\n✖ rendering pages...\r\nbuild error:\r\n TypeError: Cannot read property 'imports' of undefined\r\n at resolvePageImports (x/node_modules/vitepress/dist/node/build/render.js:81:22)\r\n at Object.renderPage (x/node_modules/vitepress/dist/node/build/render.js:35:12)\r\n at async Object.build (x/node_modules/vitepress/dist/node/build/build.js:29:17)\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```\r\n\r\nhttps://github.com/vuejs/vitepress/blob/master/src/node/build/render.ts#L115\r\n\n\n### Reproduction\n\n``` bash\r\ncd docs\r\nln -s ../CHANGELOG.md changelog.md\r\nln -s ../packages components \r\n```\n\n### Expected behavior\n\n`build` success same as `dev`\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 11.4\r\n CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz\r\n Memory: 710.10 MB / 16.00 GB\r\n Shell: 5.8 - /bin/zsh\r\n Binaries:\r\n Node: 14.17.0 - /usr/local/bin/node\r\n Yarn: 1.22.10 - /usr/local/bin/yarn\r\n npm: 6.14.13 - /usr/local/bin/npm\r\n Watchman: 4.9.0 - /usr/local/bin/watchman\r\n Browsers:\r\n Chrome: 91.0.4472.164\r\n Edge: 81.0.416.77\r\n Firefox: 87.0\r\n Safari: 14.1.1\r\n Safari Technology Preview: 15.0\r\n npmPackages:\r\n vitepress: ^0.15.6 => 0.15.6\n```\n\n\n### Additional context\n\nThe following code works fine\r\n```\r\n return Array.from(new Set([\r\n ...indexChunk.imports,\r\n ...indexChunk.dynamicImports,\r\n ...(pageChunk?.imports|| []),\r\n ...(pageChunk?.dynamicImports || [])\r\n ].filter(Boolean)));\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.",[3079],{"name":3020,"color":3021},335,"build failed with symbolic links","2023-01-21T16:20:24Z","https://github.com/vuejs/vitepress/issues/335",0.658936,{"description":3086,"labels":3087,"number":3089,"owner":3023,"repository":3024,"state":3025,"title":3090,"updated_at":3091,"url":3092,"score":3093},"### Describe the bug\n\nin my markdown file i have\n\n```\n---\nhello: world\n---\n\n## Markdown Content\n\n\u003Cp v-for=\"a in [1, 23]\"\n :key=\"1\"\n >\n {{ a }}\n\u003C/p>\n\n```\nNormally a vuejs app shows a warning that the key is duplicate, but it does not happen in a vitepress app. \n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-4jdq3cfy?file=docs%2Fexample.md\n\n### Expected behavior\n\nin dev mode the warning should be shown\n\n### System Info\n\n```Text\nSystem:\n OS: Linux 6.8 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)\n CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz\n Memory: 14.78 GB / 30.23 GB\n Container: Yes\n Shell: 5.2.21 - /bin/bash\n Binaries:\n Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node\n Yarn: 4.6.0 - ~/.yarn/bin/yarn\n npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm\n Browsers:\n Brave Browser: 133.1.75.178\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.",[3088],{"name":3061,"color":3062},4577,"vitepress does not show vue warnings","2025-03-13T04:44:38Z","https://github.com/vuejs/vitepress/issues/4577",0.6640218,{"description":3095,"labels":3096,"number":3098,"owner":3023,"repository":3024,"state":3025,"title":3099,"updated_at":3100,"url":3101,"score":3102},"### Describe the bug\n\nFailed to import the file from the relative path after rewriting。\r\n\r\n\r\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-9syvzp?file=docs%2F.vitepress%2Fconfig.ts\n\n### Expected behavior\n\nI want to import the file successfully using a relative path\n\n### System Info\n\n```sh\n\"vitepress\": \"1.0.0-beta.5\"\r\n\"node\": \"18.16.0\"\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.",[3097],{"name":3020,"color":3021},2662,"after rewrite, import error","2023-07-29T00:04:14Z","https://github.com/vuejs/vitepress/issues/2662",0.66609806,{"description":3104,"labels":3105,"number":3107,"owner":3023,"repository":3024,"state":3025,"title":3108,"updated_at":3109,"url":3110,"score":3111},"### 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.",[3106],{"name":3020,"color":3021},3485,"Using vue to report errors in markdown","2024-01-29T00:04:28Z","https://github.com/vuejs/vitepress/issues/3485",0.6669629,["Reactive",3113],{},["Set"],["ShallowReactive",3116],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fGvkS6R4yD8GDRxe4XGfr3K2K8cUQ6tP5gs-Wz0QlemY":-1},"/vuejs/vitepress/2856"]