Skip to content

Commit baaa5c7

Browse files
committed
fix: vitepress-plugin-mermaid 주입 및 빌드 최적화 에러 해결
- `.vitepress/theme/index.ts` 내 수동 '<Mermaid>' 컴포넌트 import 및 `app.component` 전역 등록 코드 제거. (최신 버전의 `vitepress-plugin-mermaid`가 자체적으로 이를 주입하기 때문에 중복 발생 시 모듈을 찾을 수 없다는 리졸빙 에러 이슈 수정) - `debug` 패키지를 개발 환경 의존성(devDependencies)에 수동으로 추가. `vitepress-plugin-mermaid` 플러그인이 Vite의 `optimizeDeps.include`에 `debug` 패키지를 강제로 포함시키지만, 최신(v11+)의 mermaid 패키지는 이를 더 이상 제공하지 않음. 이로 인해 Vite의 종속성 사전 최적화(esbuild pre-bundling) 과정이 실패하고 VitePress 코어 앱 데이터 주입 과정이 꼬이면서 발생하는 'vitepress data not properly injected in app' 에러 해결.
1 parent a5e20ce commit baaa5c7

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

.vitepress/theme/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import DefaultTheme from "vitepress/theme";
55
import Giscus from "@giscus/vue";
66
import PostCardList from "@/components/PostCardList/PostCardList.vue";
77
import PostLayout from "@/components/PostLayout/PostLayout.vue";
8-
import { MermaidPlugin } from "vitepress-plugin-mermaid";
98
import "./style.css";
109

1110
export default {
@@ -14,6 +13,5 @@ export default {
1413
enhanceApp({ app, router, siteData }) {
1514
app.component("PostCardList", PostCardList);
1615
app.component("Giscus", Giscus);
17-
app.use(MermaidPlugin);
1816
},
1917
} satisfies Theme;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
},
88
"devDependencies": {
99
"@types/node": "^24.5.2",
10+
"debug": "^4.4.3",
1011
"fast-glob": "^3.3.3",
1112
"glob": "^11.0.3",
1213
"gray-matter": "^4.0.3",

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,13 @@ dayjs@^1.11.19:
17031703
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.20.tgz#88d919fd639dc991415da5f4cb6f1b6650811938"
17041704
integrity sha512-YbwwqR/uYpeoP4pu043q+LTDLFBLApUP6VxRihdfNTqu4ubqMlGDLd6ErXhEgsyvY0K6nCs7nggYumAN+9uEuQ==
17051705

1706+
debug@^4.4.3:
1707+
version "4.4.3"
1708+
resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a"
1709+
integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==
1710+
dependencies:
1711+
ms "^2.1.3"
1712+
17061713
delaunator@5:
17071714
version "5.1.0"
17081715
resolved "https://registry.yarnpkg.com/delaunator/-/delaunator-5.1.0.tgz#d13271fbf3aff6753f9ea6e235557f20901046ea"
@@ -2223,6 +2230,11 @@ mlly@^1.7.4, mlly@^1.8.0:
22232230
pkg-types "^1.3.1"
22242231
ufo "^1.6.3"
22252232

2233+
ms@^2.1.3:
2234+
version "2.1.3"
2235+
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
2236+
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
2237+
22262238
nanoid@^3.3.11:
22272239
version "3.3.11"
22282240
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b"

0 commit comments

Comments
 (0)