You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the document boot method and neither npm nor pnpm could run the docs:dev command properly
X [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]
node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1373:27:
1373 │ let result = await callback({
╵ ^
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
at requestCallbacks.on-resolve (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:1373:28)
at handleRequest (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:729:19)
at handleIncomingPacket (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:755:7)
at Socket.readFromStdout (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:679:7)
at Socket.emit (node:events:514:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
This error came from the "onResolve" callback registered here:
node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1292:20:
1292 │ let promise = setup({
╵ ^
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)
at handlePlugins (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:1292:21)
at buildOrContextImpl (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:978:5)
at Object.buildOrContext (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:786:5)
at F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:2177:15
at new Promise (<anonymous>)
at Object.build (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:2176:25)
at build (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:2025:51)
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)
The plugin "externalize-deps" was triggered by this import
docs/.vitepress/config.ts:1:339:
1 │ ..._import_meta_url = "file:///F:/myVitepressBlog/hanwuBlog/docs/.vitepress/config.ts";import { defineConfig } from 'vitepress'
╵ ~~~~~~~~~~~
failed to load config from F:\myVitepressBlog\hanwuBlog\docs\.vitepress\config.ts
failed to start server. error:
Error: Build failed with 1 error:
node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild/lib/main.js:1373:27: ERROR: [plugin: externalize-deps] "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.
at failureErrorWithLog (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:1649:15)
at F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:1058:25
at runOnEndCallbacks (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:1484:45)
at buildResponseToResult (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:1056:7)
at F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:1085:16
at responseCallbacks.<computed> (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:703:9)
at handleIncomingPacket (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:762:9)
at Socket.readFromStdout (F:\myVitepressBlog\hanwuBlog\node_modules\.pnpm\esbuild@0.18.20\node_modules\esbuild\lib\main.js:679:7)
at Socket.emit (node:events:514:28)
at addChunk (node:internal/streams/readable:324:12)
ELIFECYCLE Command failed with exit code 1.
Reproduction
I started by introducing the latest vue
My version of node is v18.17.1
npm create vue@latest
cd vue-projecr
pnpm install
Then start installing vitepress with pnpm
pnpm add -D vitepress
pnpm exec vitepress init
┌ Welcome to VitePress!
│
◇ Where should VitePress initialize the config?
│ ./docs
│
◇ Site title:
│ My Awesome Project
│
◇ Site description:
│ A VitePress Site
│
◇ Theme:
│ Default Theme
│
◇ Use TypeScript for config and theme files?
│ Yes
│
◇ Add VitePress npm scripts to package.json?
│ Yes
│
└ Done! Now run npm run docs:dev and start writing.
When I run
pnpm run docs:dev
It doesn't work properly
I don't know how to solve it
Rename .vitepress/config.ts to .vitepress/config.mts, or add "type": "module" to your package.json. vitepress init should already have done that though 👀
hanwu1314
changed the title
I can't start properly
Ignore me. This is a low-level boot problem
Aug 31, 2023
Describe the bug
I used the document boot method and neither npm nor pnpm could run the docs:dev command properly
Reproduction
I started by introducing the latest vue
My version of node is v18.17.1
npm create vue@latest cd vue-projecr pnpm install
Then start installing vitepress with pnpm
pnpm add -D vitepress pnpm exec vitepress init
When I run
It doesn't work properly
I don't know how to solve it
Expected behavior
I hope it starts up properly, just like vue
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: