Skip to content

Commit 28d5e30

Browse files
committed
๐Ÿ–‹๏ธ NextJS ํฌ๋กฌ ์ต์Šคํ…์…˜ ํ•˜์ด๋“œ๋ ˆ์ด์…˜ ์˜ค๋ฅ˜ ๋…ธํŠธ ์ถ”๊ฐ€
1 parent 557cbe1 commit 28d5e30

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: NextJS ํฌ๋กฌ ์ต์Šคํ…์…˜ ํ•˜์ด๋“œ๋ ˆ์ด์…˜ ์˜ค๋ฅ˜
3+
description: Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used
4+
date: 2025-03-04
5+
updatedDate: 2025-03-04
6+
tags: [nextjs, nextjs chrome extension]
7+
category: nextjs
8+
image: ''
9+
---
10+
11+
![](/images/nextjs-chrome-extension-error/chrome-extension-error.avif)
12+
13+
> Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used
14+
15+
ํฌ๋กฌ ์ต์Šคํ…์…˜ ์‚ฌ์šฉ์œผ๋กœ ์œ„์™€ ๊ฐ™์€ ํ•˜์ด๋“œ๋ ˆ์ด์…˜ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.
16+
**ํฌ๋กฌ ์ต์Šคํ…์…˜์ด DOM์„ ๋ณ€๊ฒฝ**ํ•˜์—ฌ Next.js๊ฐ€ ์„œ๋ฒ„์—์„œ ๋ Œ๋”๋งํ•œ HTML๊ณผ ํด๋ผ์ด์–ธํŠธ์—์„œ ๋ Œ๋”๋ง ๋œ HTML์ด ์ผ์น˜ํ•˜์ง€ ์•Š์•„์„œ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜์ด๋‹ค.
17+
18+
```jsx highlight={3}
19+
export default function RootLayout({ children }) {
20+
return (
21+
<html lang="ko" suppressHydrationWarning>
22+
{/* ... */}
23+
</html>
24+
)
25+
}
26+
```
27+
28+
html ํƒœ๊ทธ์— `suppressHydrationWarning`๋ฅผ ์ถ”๊ฐ€ํ•ด ํ•˜์ด๋“œ๋ ˆ์ด์…˜ ๋ถˆ์ผ์น˜๋ฅผ ๊ฐ์ง€ํ–ˆ์„ ๋•Œ **๊ฒฝ๊ณ ๋ฅผ ์ˆจ๊ธธ ์ˆ˜ ์žˆ๋‹ค.** html ํƒœ๊ทธ์—๋งŒ ์†์„ฑ์„ ์ถ”๊ฐ€ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ์—์„œ ํ•˜์ด๋“œ๋ ˆ์ด์…˜ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด ๊ฒฝ๊ณ ๊ฐ€ ํ‘œ์‹œ๋œ๋‹ค.
29+
30+
:::warning
31+
์ด ๋ฐฉ๋ฒ•์€ ๋‹จ์ˆœํžˆ **๊ฒฝ๊ณ ๋ฅผ ์ˆจ๊ธฐ๋Š” ๊ฒƒ**์ด๋ฏ€๋กœ ํฌ๋กฌ ์ต์Šคํ…์…˜์ด ์•„๋‹Œ **๋‹ค๋ฅธ ์›์ธ์œผ๋กœ ํ•ด๋‹น ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒ**ํ•œ๋‹ค๋ฉด **์ •ํ™•ํ•œ ์›์ธ์„ ์ฐพ์•„ ํ•ด๊ฒฐ**ํ•ด์•ผ ํ•œ๋‹ค.
32+
:::

โ€Žsrc/styles/mdx.cssโ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,9 @@ html.dark pre.astro-code span.highlighted span {
518518
.mdx .callout svg {
519519
width: 16px;
520520
height: 16px;
521+
flex-shrink: 0;
522+
align-self: baseline;
523+
margin-top: 0.3em;
521524
}
522525
.mdx .callout[data-variant='title'] {
523526
display: block;

0 commit comments

Comments
ย (0)