\n\n请问使用的库打包文件中有Worker,但是打包环境没有worker切报错应该怎么解决?\n\n",[],4937,"构建时报错 Worker is not defined","2025-09-08T08:34:41Z","https://github.com/vuejs/vitepress/issues/4937",0.7890456,{"description":3213,"labels":3214,"number":3216,"owner":3155,"repository":3156,"state":3157,"title":3217,"updated_at":3218,"url":3219,"score":3220},"### Is your feature request related to a problem? Please describe.\r\n\r\n如下代码,支持 it('xxxxxx', () => { /* code */}) 代码折叠\r\n\r\n\u003Cpre>\r\n```typescript:line-numbers [范例]\r\nimport Login from \"@/views/auth/Login.vue\";\r\n\r\ndescribe(\"Vue Component\", () => {\r\n it(\"挂载渲染 - Login 组件\", () => {\r\n cy.mount(Login);\r\n });\r\n\r\n it(\"模拟触发 - Input 校验\", () => {\r\n cy.mount(Login);\r\n\r\n cy.get('input[type=\"text\"]').as(\"usernameInput\");\r\n cy.get('input[type=\"password\"]').as(\"passwordInput\");\r\n\r\n cy.get(\"@usernameInput\").type(\"admin\");\r\n cy.get(\"@passwordInput\").type(\"password\");\r\n\r\n cy.get(\"@usernameInput\").should(\"have.value\", \"admin\");\r\n cy.get(\"@passwordInput\").should(\"have.value\", \"password\");\r\n });\r\n});\r\n```\r\n\u003C/pre>\r\n\r\n### Describe the solution you'd like\r\n\r\n通过 // [!code collapse:\u003C+/-lines>] 支持代码折叠 (其中,lines 可折叠部分的行数,+line -> 默认展开, -line 默认已折叠)\r\n\u003Cpre>\r\n```typescript:line-numbers [范例]\r\nimport Login from \"@/views/auth/Login.vue\";\r\n\r\ndescribe(\"Vue Component\", () => {\r\n it(\"挂载渲染 - Login 组件\", () => { // [!code collapse:3]\r\n cy.mount(Login);\r\n });\r\n\r\n it(\"模拟触发 - Input 校验\", () => { // [!code collapse:-12]\r\n cy.mount(Login);\r\n\r\n cy.get('input[type=\"text\"]').as(\"usernameInput\");\r\n cy.get('input[type=\"password\"]').as(\"passwordInput\");\r\n\r\n cy.get(\"@usernameInput\").type(\"admin\");\r\n cy.get(\"@passwordInput\").type(\"password\");\r\n\r\n cy.get(\"@usernameInput\").should(\"have.value\", \"admin\");\r\n cy.get(\"@passwordInput\").should(\"have.value\", \"password\");\r\n });\r\n});\r\n```\r\n\u003C/pre>\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\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.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[3215],{"name":3152,"color":3153},3842,"支持 Markdown 内的代码折叠功能","2025-03-02T18:09:14Z","https://github.com/vuejs/vitepress/issues/3842",0.79104537,{"description":3222,"labels":3223,"number":3224,"owner":3155,"repository":3156,"state":3225,"title":3226,"updated_at":3227,"url":3228,"score":3229},"### Describe the bug\n\n如果使用 rewrites 重写`en/*`到`/*`,编译就会报错,注释掉 rewrites 的 3 行之后就能编译。\n\n```\n> vitepress build\n\n\n vitepress v2.0.0-alpha.4\n\n✓ building client + server bundles...\n✗ rendering pages...\nbuild error:\nCannot read properties of undefined (reading 'imports')\nTypeError: Cannot read properties of undefined (reading 'imports')\n at resolvePageImports (file:///Users/haozi/Desktop/goravel/goravel.github.io/node_modules/.pnpm/vitepress@2.0.0-alpha.4_@algolia+client-search@5.23.2_@types+node@22.14.0_less@4.3.0_po_4073d1b8bc4d01c01e2cbc48d71230e0/node_modules/vitepress/dist/node/chunk-BBDUp32J.js:45758:18)\n at renderPage (file:///Users/haozi/Desktop/goravel/goravel.github.io/node_modules/.pnpm/vitepress@2.0.0-alpha.4_@algolia+client-search@5.23.2_@types+node@22.14.0_less@4.3.0_po_4073d1b8bc4d01c01e2cbc48d71230e0/node_modules/vitepress/dist/node/chunk-BBDUp32J.js:45649:10)\n at async pMap.concurrency (file:///Users/haozi/Desktop/goravel/goravel.github.io/node_modules/.pnpm/vitepress@2.0.0-alpha.4_@algolia+client-search@5.23.2_@types+node@22.14.0_less@4.3.0_po_4073d1b8bc4d01c01e2cbc48d71230e0/node_modules/vitepress/dist/node/chunk-BBDUp32J.js:45868:11)\n at async file:///Users/haozi/Desktop/goravel/goravel.github.io/node_modules/.pnpm/vitepress@2.0.0-alpha.4_@algolia+client-search@5.23.2_@types+node@22.14.0_less@4.3.0_po_4073d1b8bc4d01c01e2cbc48d71230e0/node_modules/vitepress/dist/node/chunk-BBDUp32J.js:4504:20\n ELIFECYCLE Command failed with exit code 1.\n```\n\n\n### Reproduction\n\n使用如下配置,从 https://github.com/vuejs/vitepress/blob/main/docs/.vitepress/config/shared.ts 抄的,用来将 en 作为默认页\n\n```\nexport const shared = defineConfig({\n title: 'Goravel',\n lang: 'en',\n\n rewrites: {\n 'en/:rest*': ':rest*'\n },\n\n lastUpdated: true,\n cleanUrls: true,\n metaChunk: true,\n\n markdown: {\n codeTransformers: [\n transformerTwoslash({\n typesCache: createFileSystemTypesCache()\n })\n ],\n config(md) {\n md.use(groupIconMdPlugin);\n md.use(timeline);\n },\n languages: ['go']\n },\n\n themeConfig: {\n // https://vitepress.dev/reference/default-theme-config\n socialLinks: [\n {icon: 'github', link: 'https://github.com/goravel/goravel'},\n {icon: 'discord', link: 'https://discord.gg/cFc5csczzS'},\n ],\n },\n\n vite: {\n plugins: [\n groupIconVitePlugin()\n ],\n },\n})\n```\n\n### Expected behavior\n\n没有报错\n\n### System Info\n\n```Text\nnpx envinfo --system --npmPackages vitepress --binaries --browsers\n\n System:\n OS: macOS 15.4\n CPU: (10) arm64 Apple M4\n Memory: 150.25 MB / 32.00 GB\n Shell: 5.9 - /bin/zsh\n Binaries:\n Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node\n npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm\n pnpm: 10.7.1 - ~/.nvm/versions/node/v22.14.0/bin/pnpm\n Browsers:\n Safari: 18.4\n npmPackages:\n vitepress: 2.0.0-alpha.4 => 2.0.0-alpha.4\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.",[],4678,"closed","rewrites 重写报错 Cannot read properties of undefined (reading 'imports')","2025-04-06T08:31:38Z","https://github.com/vuejs/vitepress/issues/4678",0.7410527,{"description":3231,"labels":3232,"number":3236,"owner":3155,"repository":3156,"state":3225,"title":3237,"updated_at":3238,"url":3239,"score":3240},"Hi, I'm using Backblaze + Cloudflare to host my images. When I'm using vitepress I found the images' response header `cf-cache-status` is always `MISS`.\r\n\r\nI checked the request header and I found `cache-control` and `pragma` values are both `no-cache`. When I imported the same request into Postman and modified both `cache-control` and `pragma` to `max-age=86400`, the response header `cf-cache-status` turned to `HIT`. I think the problem is here.\r\n\r\nIs there any method that I can configure the cache related request header of imgs?\r\n\r\nMany thanks!",[3233],{"name":3234,"color":3235},"question","5D5FAE",1763,"How to configure \"cache-control\" header when request remote imgs?","2023-01-06T05:47:47Z","https://github.com/vuejs/vitepress/issues/1763",0.74820846,{"description":3242,"labels":3243,"number":3247,"owner":3155,"repository":3156,"state":3225,"title":3248,"updated_at":3249,"url":3250,"score":3251},"### Describe the bug\n\nI am trying to build VitePress with a directory of Markdown that was generated by typedoc. The Markdown is valid and the VitePress dev server works fine, but the build fails:\n\n```\n> vitepress build vitepress-config\n\n vitepress v1.6.3\n\n- building client + server bundles...\nx Build failed in 6.89s\n✖ building client + server bundles...\nbuild error:\n[vite:vue] [plugin vite:vue] docs/@arista/protobuf/type-aliases/PartialMessage.md (12:18): Element is missing end tag.\nfile: .../apps/api-docs/docs/@arista/protobuf/type-aliases/PartialMessage.md:12:18\n[vite:vue] [plugin vite:vue] docs/@arista/protobuf/type-aliases/PartialMessage.md (12:18): Element is missing end tag.\nfile: .../apps/api-docs/docs/@arista/protobuf/type-aliases/PartialMessage.md:12:18\nSyntaxError: [plugin vite:vue] docs/@arista/protobuf/type-aliases/PartialMessage.md (12:18): Element is missing end tag.\n at createCompilerError (...\\common\\temp\\node_modules\\.pnpm\\@vue+compiler-core@3.5.13\\node_modules\\@vue\\compiler-core\\dist\\compiler-core.cjs.prod.js:1360:17)\n at emitError (...\\common\\temp\\node_modules\\.pnpm\\@vue+compiler-core@3.5.13\\node_modules\\@vue\\compiler-core\\dist\\compiler-core.cjs.prod.js:2915:5)\n at Object.onclosetag (...\\common\\temp\\node_modules\\.pnpm\\@vue+compiler-core@3.5.13\\node_modules\\@vue\\compiler-core\\dist\\compiler-core.cjs.prod.js:2304:13)\n at Tokenizer.stateInClosingTagName (...\\common\\temp\\node_modules\\.pnpm\\@vue+compiler-core@3.5.13\\node_modules\\@vue\\compiler-core\\dist\\compiler-core.cjs.prod.js:785:16)\n at Tokenizer.parse (...\\common\\temp\\node_modules\\.pnpm\\@vue+compiler-core@3.5.13\\node_modules\\@vue\\compiler-core\\dist\\compiler-core.cjs.prod.js:1143:16)\n at Object.baseParse (...\\common\\temp\\node_modules\\.pnpm\\@vue+compiler-core@3.5.13\\node_modules\\@vue\\compiler-core\\dist\\compiler-core.cjs.prod.js:2947:13)\n at Object.parse (...\\common\\temp\\node_modules\\.pnpm\\@vue+compiler-dom@3.5.13\\node_modules\\@vue\\compiler-dom\\dist\\compiler-dom.cjs.prod.js:662:23)\n at Object.parse$1 [as parse] (...\\common\\temp\\node_modules\\.pnpm\\@vue+compiler-sfc@3.5.13\\node_modules\\@vue\\compiler-sfc\\dist\\compiler-sfc.cjs.js:1794:24)\n at createDescriptor (file:///.../common/temp/node_modules/.pnpm/@vitejs+plugin-vue@5.2.1_vite@5.4.14_@types+node@22.13.5_less@4.2.2_lightningcss@1.29.1_terse_4j27thiklgdj7aklsxuoohqi3m/node_modules/@vitejs/plugin-vue/dist/index.mjs:71:43)\n at transformMain (file:///.../common/temp/node_modules/.pnpm/@vitejs+plugin-vue@5.2.1_vite@5.4.14_@types+node@22.13.5_less@4.2.2_lightningcss@1.29.1_terse_4j27thiklgdj7aklsxuoohqi3m/node_modules/@vitejs/plugin-vue/dist/index.mjs:2430:34)\n```\n\n### Reproduction\n\nHere is the original TypeScript:\n\n```\n/**\n * PartialMessage\u003CT> constructs a type from a message. The resulting type\n * only contains the protobuf field members of the message, and all of them\n * are optional.\n *\n * Note that the optionality of the fields is the only difference between\n * PartialMessage and PlainMessage.\n *\n * PartialMessage is similar to the built-in type Partial\u003CT>, but recursive,\n * and respects `oneof` groups.\n */\nexport type PartialMessage\u003CT extends Message\u003CT>> = {\n [P in keyof T as T[P] extends Function ? never : P]?: PartialField\u003CT[P]>;\n};\n```\n\nAfter running the code through typedoc, here is the Markdown output:\n\n```\n[**@arista/protobuf v1.8.0**](../README.md)\n\n***\n\n[Documentation](../../../README.md) / [@arista/protobuf](../README.md) / PartialMessage\n\n# Type Alias: PartialMessage\\\u003CT\\>\n\n> **PartialMessage**\\\u003C`T`\\>: `{ [P in keyof T as T[P] extends Function ? never : P]?: PartialField\u003CT[P]> }`\n\nDefined in: message.ts:198\n\nPartialMessage\u003CT> constructs a type from a message. The resulting type\nonly contains the protobuf field members of the message, and all of them\nare optional.\n\nNote that the optionality of the fields is the only difference between\nPartialMessage and PlainMessage.\n\nPartialMessage is similar to the built-in type Partial\u003CT>, but recursive,\nand respects `oneof` groups.\n\n## Type Parameters\n\n• **T** *extends* [`Message`](../classes/Message.md)\\\u003C`T`\\>\n```\n\nThis Markdown is valid; I tried rendering it with vscode and several online live preview sites. Here's what it looks like in vscode:\n\n\n\n### Expected behavior\n\nVitePress should accept this Markdown and build without errors.\n\n### System Info\n\n```Text\nSystem:\n OS: Windows 11 10.0.26100\n CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz\n Memory: 1.96 GB / 15.71 GB\n Binaries:\n Node: 22.14.0 - C:\\Program Files\\Node.js\\node.EXE\n npm: 11.1.0 - C:\\Program Files\\Node.js\\npm.CMD\n Browsers:\n Edge: Chromium (131.0.2903.86)\n Internet Explorer: 11.0.26100.1882\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.",[3244],{"name":3245,"color":3246},"bug: pending triage","e99695",4597,"SyntaxError: [plugin vite:vue] Element is missing end tag","2025-03-13T04:44:37Z","https://github.com/vuejs/vitepress/issues/4597",0.76751006,["Reactive",3253],{},["Set"],["ShallowReactive",3256],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fYOzhsvuHhgNZa0PY5T9Lh0X_DSRcNPWjiIPvpEKMGNw":-1},"/vuejs/vitepress/4595"]