\r\n\r\nIt is inevitable to use `document` in `vitepress` many times, but how to avoid the packaging error when` vitepress` uses the server-side rendering method?\r\n\r\nAre there any third-party plug-in recommendations or configuration items?\n\n### Reproduction\n\n```vue\r\n\u003Cscript setup>\r\n console.log(document)\r\n\u003C/script>\r\n```\r\n\r\n\r\n\n\n### Expected behavior\n\nBuild ok\n\n### System Info\n\n```shell\n\"vitepress\": \"^1.0.0-alpha.4\",\r\n\"vue\": \"^3.2.33\"\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.",[2890],{"name":2891,"color":2892},"question","5D5FAE",1120,"document is not defined","2023-01-21T14:28:51Z","https://github.com/vuejs/vitepress/issues/1120",0.6371464,{"description":2899,"labels":2900,"number":2902,"owner":2871,"repository":2872,"state":2873,"title":2903,"updated_at":2904,"url":2905,"score":2906},"### Describe the bug\n\nvitepress v0.22.2\r\n✓ building client + server bundles...\r\n⠙ rendering pages...ReferenceError: Blob is not defined\r\n at Module.\u003Canonymous> (...\\docs\\.vitepress\\.temp\\File_Blob.md.js:6:11)\r\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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 Module.require (node:internal/modules/cjs/loader:1005:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at ...e\\docs\\.vitepress\\.temp\\app.js:1817:12\r\n at loadPage (...\\docs\\.vitepress\\.temp\\app.js:180:18)\r\n at Object.go (...\\docs\\.vitepress\\.temp\\app.js:173:12)\r\n✖ rendering pages...\r\nbuild error:\r\n ReferenceError: Blob is not defined\r\n at Module.\u003Canonymous> (...\\docs\\.vitepress\\.temp\\File_Blob.md.js:6:11)\r\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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 Module.require (node:internal/modules/cjs/loader:1005:19)\r\n at require (node:internal/modules/cjs/helpers:102:18)\r\n at renderPage (...\\node_modules\\vitepress\\dist\\node\\serve-cf4b2162.js:40892:26)\r\n at async Object.build (...\\node_modules\\vitepress\\dist\\node\\serve-cf4b2162.js:41023:9)\n\n### Reproduction\n\n```\r\n//BlobCreate.vue\r\n\u003Cscript>\r\nlet foo = new Blob([\"foo\"]);\r\nconsole.log(foo);\r\n\u003C/script>\r\n```\r\n```\r\n//Blob.md\r\n \u003Cscript setup>\r\nimport BlobCreate from \"./components/BlobCreate.vue\";\r\n \u003C/script>\r\n\r\n \u003CBlobCreate />\r\n```\n\n### Expected behavior\n\nsuccessfully \n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.22000\r\n CPU: (6) x64 Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz\r\n Memory: 6.54 GB / 15.88 GB\r\n Binaries:\r\n Node: 16.13.0 - C:\\nodejs\\node.EXE\r\n npm: 8.1.4 - C:\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22000.120.0), Chromium (98.0.1108.50)\r\n Internet Explorer: 11.0.22000.120\r\n npmPackages:\r\n vitepress: ^0.22.2 => 0.22.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/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.",[2901],{"name":2868,"color":2869},539,"build error:Blob is not defined","2023-01-21T16:20:11Z","https://github.com/vuejs/vitepress/issues/539",0.65205765,{"description":2908,"labels":2909,"number":2911,"owner":2871,"repository":2872,"state":2873,"title":2912,"updated_at":2913,"url":2914,"score":2915},"### Describe the bug\r\n\r\nvue version: 2.5.16\r\nvitepress version: 0.22.3\r\nnode version: 16.13.1\r\n\r\nshell error:\r\n\r\n```shell\r\n$ vite docs build\r\n\r\n✓ building client + server bundles...\r\n✖ rendering pages...\r\nbuild error:\r\n TypeError: vue.shallowRef is not a function\r\n at Module.\u003Canonymous> (D:\\VscodeItems\\lost-and-found-admin-front\\docs\\.vitepress\\.temp\\app.js:80:25)\r\n at Module._compile (internal/modules/cjs/loader.js:1085:14)\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:790:12)\r\n at Module.require (internal/modules/cjs/loader.js:974:19)\r\n at require (internal/modules/cjs/helpers.js:93:18)\r\n at renderPage (D:\\VscodeItems\\lost-and-found-admin-front\\node_modules\\.pnpm\\vitepress@0.22.3_stylus@0.52.4\\node_modules\\vitepress\\dist\\node\\serve-777539c0.js:40890:25)\r\n at Object.build (D:\\VscodeItems\\lost-and-found-admin-front\\node_modules\\.pnpm\\vitepress@0.22.3_stylus@0.52.4\\node_modules\\vitepress\\dist\\node\\serve-777539c0.js:41039:15)\r\n ELIFECYCLE Command failed with exit code 1.\r\n```\r\n\r\n### Reproduction\r\n\r\nnot sure\r\n\r\n### Expected behavior\r\n\r\nnot sure\r\n\r\n### System Info\r\n\r\n```shell\r\n$ npx envinfo --system --npmPackages vitepress --binaries --browsers\r\n\r\nnpm ERR! cb.apply is not a function\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR! C:\\Users\\Admin\\AppData\\Roaming\\npm-cache\\_logs\\2022-03-06T05_34_10_677Z-debug.log\r\nInstall for [ 'envinfo@latest' ] failed with code 1\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.",[2910],{"name":2868,"color":2869},571,"vue.shallowRef is not a function","2023-01-21T16:04:26Z","https://github.com/vuejs/vitepress/issues/571",0.65634143,{"description":2917,"labels":2918,"number":2920,"owner":2871,"repository":2872,"state":2873,"title":2921,"updated_at":2922,"url":2923,"score":2924},"### Describe the bug\n\nActuall I am using one pakage in vue component and I am importing my vue component in vitepress then when I am trying to build I am getting this error \r\n\r\n(!) Some chunks are larger than 500 kBs 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✓ building client + server bundles...\r\n⠙ rendering pages...ReferenceError: document is not defined\r\n at enableDismissTrigger (C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:826:21)\r\n at C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:908:3\r\n at C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:7:83\r\n at Object.\u003Canonymous> (C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:10:3) \r\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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:190:29)\r\n at ModuleJob.run (node:internal/modules/esm/module_job:185:25)\r\n✖ rendering pages...\r\nbuild error:\r\nReferenceError: document is not defined\r\n at enableDismissTrigger (C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:826:21)\r\n at C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:908:3\r\n at C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:7:83\r\n at Object.\u003Canonymous> (C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:10:3)\r\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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:190:29)\r\n at ModuleJob.run (node:internal/modules/esm/module_job:185:25)\r\nPS C:\\ArunSk\\aswin>\r\n\r\nif I comment that package and try to build it's building fine and I have added config.ts also \r\n\r\nimport { UserConfig } from 'vite';\r\n\r\nconst config: UserConfig = {\r\n // Other Vite configuration options...\r\n build: {\r\n rollupOptions: {\r\n external: /^bootstrap($|\\/)/,\r\n },\r\n ssr: false,\r\n },\r\n};\r\n\r\nexport default config;\r\n\r\nmy package.json\r\n\r\n{\r\n \"scripts\": {\r\n \"docs:dev\": \"vitepress dev docs\",\r\n \"docs:build\": \"vitepress build docs\",\r\n \"docs:preview\": \"vitepress preview docs\"\r\n },\r\n \"peerDependencies\": {\r\n \"markdown-it-container\": \"^3.0.0\",\r\n \"vitepress\": \"*\",\r\n \"vue\": \"^3.2.0\"\r\n },\r\n \"devDependencies\": {\r\n \"@types/markdown-it\": \"^12.2.3\",\r\n \"@types/markdown-it-container\": \"^2.0.5\",\r\n \"@types/node\": \"^18.16.3\",\r\n \"lint-staged\": \"^13.2.2\",\r\n \"vue\": \"^3.2.38\"\r\n },\r\n \"dependencies\": {\r\n \"bootstrap\": \"^5.2.0\",\r\n \"fire-stars\": \"^0.0.1\",\r\n \"markdown-it\": \"^13.0.1\",\r\n \"markdown-it-container\": \"^3.0.0\",\r\n \"sass\": \"^1.63.6\",\r\n \"vitepress\": \"*\",\r\n \"vue\": \"^3.2.0\"\r\n }\r\n}\r\n\r\n\n\n### Reproduction\n\nActuall I am using one pakage in vue component and I am importing my vue component in vitepress then when I am trying to build I am getting this error \r\n\r\n(!) Some chunks are larger than 500 kBs 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✓ building client + server bundles...\r\n⠙ rendering pages...ReferenceError: document is not defined\r\n at enableDismissTrigger (C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:826:21)\r\n at C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:908:3\r\n at C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:7:83\r\n at Object.\u003Canonymous> (C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:10:3) \r\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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:190:29)\r\n at ModuleJob.run (node:internal/modules/esm/module_job:185:25)\r\n✖ rendering pages...\r\nbuild error:\r\nReferenceError: document is not defined\r\n at enableDismissTrigger (C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:826:21)\r\n at C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:908:3\r\n at C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:7:83\r\n at Object.\u003Canonymous> (C:\\ArunSk\\aswin\\node_modules\\bootstrap\\dist\\js\\bootstrap.js:10:3)\r\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\r\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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:190:29)\r\n at ModuleJob.run (node:internal/modules/esm/module_job:185:25)\r\nPS C:\\ArunSk\\aswin>\r\n\r\nif I comment that package and try to build it's building fine and I have added config.ts also \r\n\r\nimport { UserConfig } from 'vite';\r\n\r\nconst config: UserConfig = {\r\n // Other Vite configuration options...\r\n build: {\r\n rollupOptions: {\r\n external: /^bootstrap($|\\/)/,\r\n },\r\n ssr: false,\r\n },\r\n};\r\n\r\nexport default config;\r\n\r\nmy package.json\r\n\r\n{\r\n \"scripts\": {\r\n \"docs:dev\": \"vitepress dev docs\",\r\n \"docs:build\": \"vitepress build docs\",\r\n \"docs:preview\": \"vitepress preview docs\"\r\n },\r\n \"peerDependencies\": {\r\n \"markdown-it-container\": \"^3.0.0\",\r\n \"vitepress\": \"*\",\r\n \"vue\": \"^3.2.0\"\r\n },\r\n \"devDependencies\": {\r\n \"@types/markdown-it\": \"^12.2.3\",\r\n \"@types/markdown-it-container\": \"^2.0.5\",\r\n \"@types/node\": \"^18.16.3\",\r\n \"lint-staged\": \"^13.2.2\",\r\n \"vue\": \"^3.2.38\"\r\n },\r\n \"dependencies\": {\r\n \"bootstrap\": \"^5.2.0\",\r\n \"fire-stars\": \"^0.0.1\",\r\n \"markdown-it\": \"^13.0.1\",\r\n \"markdown-it-container\": \"^3.0.0\",\r\n \"sass\": \"^1.63.6\",\r\n \"vitepress\": \"*\",\r\n \"vue\": \"^3.2.0\"\r\n }\r\n}\r\n\r\n\n\n### Expected behavior\n\nBuild Succesful\n\n### System Info\n\n```sh\n{\r\n \"scripts\": {\r\n \"docs:dev\": \"vitepress dev docs\",\r\n \"docs:build\": \"vitepress build docs\",\r\n \"docs:preview\": \"vitepress preview docs\"\r\n },\r\n \"peerDependencies\": {\r\n \"markdown-it-container\": \"^3.0.0\",\r\n \"vitepress\": \"*\",\r\n \"vue\": \"^3.2.0\"\r\n },\r\n \"devDependencies\": {\r\n \"@types/markdown-it\": \"^12.2.3\",\r\n \"@types/markdown-it-container\": \"^2.0.5\",\r\n \"@types/node\": \"^18.16.3\",\r\n \"lint-staged\": \"^13.2.2\",\r\n \"vue\": \"^3.2.38\"\r\n },\r\n \"dependencies\": {\r\n \"bootstrap\": \"^5.2.0\",\r\n \"fire-stars\": \"^0.0.1\",\r\n \"markdown-it\": \"^13.0.1\",\r\n \"markdown-it-container\": \"^3.0.0\",\r\n \"sass\": \"^1.63.6\",\r\n \"vitepress\": \"*\",\r\n \"vue\": \"^3.2.0\"\r\n }\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.",[2919],{"name":2868,"color":2869},2633,"Document is Not defined while building","2023-07-27T00:04:20Z","https://github.com/vuejs/vitepress/issues/2633",0.65656674,{"description":2926,"labels":2927,"number":2934,"owner":2871,"repository":2872,"state":2873,"title":2935,"updated_at":2936,"url":2937,"score":2938},"### Describe the bug\n\nWhile running for production : npm run docs:build, then \"SyntaxError: The requested module 'vue' does not provide an export named 'computed'\" occurred.\n\n### Reproduction\n\nTry to build it for production : npm run docs:build\r\n\"devDependencies\": {\r\n \"vitepress\": \"^1.0.0-beta.5\"\r\n }\r\n\n\n### Expected behavior\n\nIt should build the docs for production.\n\n### System Info\n\n```sh\nWindows Machine,\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.",[2928,2931],{"name":2929,"color":2930},"build","377ba8",{"name":2932,"color":2933},"has-workaround","1B4515",2593,"While building for production vitepress gives syntax error","2023-09-02T00:04:06Z","https://github.com/vuejs/vitepress/issues/2593",0.65973943,{"description":2940,"labels":2941,"number":2942,"owner":2871,"repository":2872,"state":2873,"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.6606019,{"description":2948,"labels":2949,"number":2951,"owner":2871,"repository":2872,"state":2873,"title":2952,"updated_at":2953,"url":2954,"score":2955},"### Describe the bug\n\nvitepress dependency error\n\n### Reproduction\n\nErrors reported during project startup and packaging\n\n### Expected behavior\n\nproject can start and package normally\n\n### System Info\n\n```shell\nError: 'defineEmit' is not exported by node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js, imported by node_modules/vitepress/dist/client/theme-default/components/NavBar.vue?vue&type=script&setup=true&lang.ts\n```\n\n\n### Additional context\n\n_No response_\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.",[2950],{"name":2868,"color":2869},357,"Project not working","2023-01-21T16:22:15Z","https://github.com/vuejs/vitepress/issues/357",0.66493213,{"description":2957,"labels":2958,"number":2960,"owner":2871,"repository":2872,"state":2873,"title":2961,"updated_at":2962,"url":2963,"score":2964},"### Describe the bug\n\nI used the document boot method and neither npm nor pnpm could run the docs:dev command properly\r\n\r\n```sh\r\nX [ERROR] \"vitepress\" resolved to an ESM file. ESM file cannot be loaded by `require`. See http://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details. [plugin externalize-deps]\r\n\r\n node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1373:27:\r\n 1373 │ let result = await callback({\r\n ╵ ^\r\n\r\n at file:///F:/myVitepressBlog/hanwuBlog/node_modules/.pnpm/vite@4.4.9_@types+node@18.17.5/node_modules/vite/dist/node/chunks/dep-df561101.js:66190:35\r\n at requestCallbacks.on-resolve (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:1373:28)\r\n at handleRequest (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:729:19)\r\n at handleIncomingPacket (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:755:7) \r\n at Socket.readFromStdout (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:679:7) \r\n at Socket.emit (node:events:514:28)\r\n at addChunk (node:internal/streams/readable:324:12)\r\n at readableAddChunk (node:internal/streams/readable:297:9)\r\n at Readable.push (node:internal/streams/readable:234:10)\r\n at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)\r\n\r\n This error came from the \"onResolve\" callback registered here:\r\n\r\n node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1292:20:\r\n 1292 │ let promise = setup({\r\n ╵ ^\r\n\r\n at setup (file:///F:/myVitepressBlog/hanwuBlog/node_modules/.pnpm/vite@4.4.9_@types+node@18.17.5/node_modules/vite/dist/node/chunks/dep-df561101.js:66158:27)\r\n at handlePlugins (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:1292:21)\r\n at buildOrContextImpl (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:978:5) \r\n at Object.buildOrContext (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:786:5) \r\n at F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:2177:15\r\n at new Promise (\u003Canonymous>)\r\n at Object.build (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:2176:25)\r\n at build (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:2025:51)\r\n at bundleConfigFile (file:///F:/myVitepressBlog/hanwuBlog/node_modules/.pnpm/vite@4.4.9_@types+node@18.17.5/node_modules/vite/dist/node/chunks/dep-df561101.js:66109:26)\r\n\r\n The plugin \"externalize-deps\" was triggered by this import\r\n\r\n docs/.vitepress/config.ts:1:339:\r\n 1 │ ..._import_meta_url = \"file:///F:/myVitepressBlog/hanwuBlog/docs/.vitepress/config.ts\";import { defineConfig } from 'vitepress' \r\n ╵ ~~~~~~~~~~~ \r\n\r\nfailed to load config from F:\\myVitepressBlog\\hanwuBlog\\docs\\.vitepress\\config.ts\r\nfailed to start server. error:\r\nError: Build failed with 1 error:\r\nnode_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1373:27: ERROR: [plugin: externalize-deps] \"vitepress\" resolved to an \r\nESM file. ESM file cannot be loaded by `require`. See http://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details.\r\n at failureErrorWithLog (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:1649:15) \r\n at F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:1058:25\r\n at runOnEndCallbacks (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:1484:45) \r\n at buildResponseToResult (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:1056:7) \r\n at F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:1085:16\r\n at responseCallbacks.\u003Ccomputed> (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:703:9)\r\n at handleIncomingPacket (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:762:9) \r\n at Socket.readFromStdout (F:\\myVitepressBlog\\hanwuBlog\\node_modules\\.pnpm\\esbuild@0.18.20\\node_modules\\esbuild\\lib\\main.js:679:7) \r\n at Socket.emit (node:events:514:28)\r\n at addChunk (node:internal/streams/readable:324:12)\r\n ELIFECYCLE Command failed with exit code 1.\r\n\r\n\r\n```\n\n### Reproduction\n\nI started by introducing the latest vue\r\nMy version of node is v18.17.1\r\n```sh\r\nnpm create vue@latest\r\ncd vue-projecr\r\npnpm install\r\n```\r\nThen start installing vitepress with pnpm\r\n\r\n```sh\r\npnpm add -D vitepress\r\npnpm exec vitepress init\r\n```\r\n\r\n```sh\r\n┌ Welcome to VitePress! \r\n│\r\n◇ Where should VitePress initialize the config?\r\n│ ./docs\r\n│\r\n◇ Site title:\r\n│ My Awesome Project\r\n│\r\n◇ Site description:\r\n│ A VitePress Site\r\n│\r\n◇ Theme:\r\n│ Default Theme\r\n│\r\n◇ Use TypeScript for config and theme files?\r\n│ Yes\r\n│\r\n◇ Add VitePress npm scripts to package.json?\r\n│ Yes\r\n│\r\n└ Done! Now run npm run docs:dev and start writing.\r\n```\r\n\r\nWhen I run \r\n```sh\r\npnpm run docs:dev \r\n```\r\nIt doesn't work properly\r\nI don't know how to solve it\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n### Expected behavior\n\nI hope it starts up properly, just like vue\n\n### System Info\n\n```sh\nSystem:\r\n OS: Windows 10 10.0.19045\r\n CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics\r\n Memory: 5.94 GB / 15.86 GB\r\n Binaries:\r\n Node: 18.17.1 - C:\\Program Files\\nodejs\\node.EXE\r\n Yarn: 1.22.19 - C:\\Program Files\\nodejs\\yarn.CMD\r\n npm: 9.6.7 - C:\\Program Files\\nodejs\\npm.CMD\r\n pnpm: 8.6.12 - C:\\Program Files\\nodejs\\pnpm.CMD\r\n Browsers:\r\n Edge: Spartan (44.19041.1266.0), Chromium (116.0.1938.62) \r\n Internet Explorer: 11.0.19041.1566\r\n npmPackages:\r\n vitepress: 1.0.0-rc.10 => 1.0.0-rc.10\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.",[2959],{"name":2868,"color":2869},2886,"Ignore me. This is a low-level boot problem","2023-09-08T00:04:13Z","https://github.com/vuejs/vitepress/issues/2886",0.66523075,["Reactive",2966],{},["Set"],["ShallowReactive",2969],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fblPFzIpDDBSmekMivR1IHK-jWyB5CHxLmsDCsI2u2s4":-1},"/vuejs/vitepress/1638"]