Closed DvShu closed 2 weeks ago
When I run npm run docs:build, I get the error: ReferenceError: document is not defined
npm run docs:build
If there is anything about node manipulation in my code, it will report an error. egg: document、DOMParser
When I run npm run docs:dev its fine! But when i run npm run npm run docs:build i got the error.
run docs:dev
System: OS: Windows 11 10.0.22631 CPU: (16) x64 Intel(R) Core(TM) i7-10870H CPU @ 2.20GHz Memory: 4.36 GB / 15.83 GB Binaries: Node: 21.7.1 - D:\developer tool\nodejs\node.EXE Yarn: 1.22.19 - D:\developer tool\nodejs\yarn.CMD npm: 10.5.0 - D:\developer tool\nodejs\npm.CMD pnpm: 8.15.6 - D:\developer tool\nodejs\pnpm.CMD Browsers: Edge: Chromium (123.0.2420.81) Internet Explorer: 11.0.22621.1
https://vitepress.dev/guide/ssr-compat
Describe the bug
When I run
npm run docs:build
, I get the error: ReferenceError: document is not definedReproduction
If there is anything about node manipulation in my code, it will report an error. egg: document、DOMParser
Expected behavior
When I run npm
run docs:dev
its fine! But when i run npm runnpm run docs:build
i got the error.System Info
Additional context
Validations