Skip to content

๐ŸŸก[P2] fix(frontend): generic ErrorBoundary defined but not mounted at app root โ€” provider tree uncoveredย #84

Description

@teddylee777

์ปจํ…์ŠคํŠธ ๋ธ”๋ก

Key Value
Category frontend
Checklist ISS-UI-R8 โ€” Missing React error boundaries for client-side crashes
Priority P2 ๐ŸŸก
Scan Date 2026-04-16
Flagged By @code-review

์š”์•ฝ

  • WHAT: frontend/src/shared/components/ErrorBoundary.tsx์— generic ErrorBoundary ์ •์˜๋˜์–ด ์žˆ์œผ๋‚˜ app/layout.tsx๋‚˜ MainLayoutClient.tsx์—์„œ ๋งˆ์šดํŠธ๋˜์ง€ ์•Š์Œ. ThreadErrorBoundary๋งŒ thread view ๋‚ด๋ถ€์— ์‚ฌ์šฉ
  • WHY: StreamProvider, AssistantConfigProvider ๋“ฑ client-side provider tree์—์„œ ๋ฐœ์ƒํ•˜๋Š” ํฌ๋ž˜์‹œ๊ฐ€ ์บ์น˜๋˜์ง€ ์•Š์•„ ์ „์ฒด ํŽ˜์ด์ง€ white screen
  • WHERE: frontend/src/shared/components/ErrorBoundary.tsx (์ •์˜), frontend/src/app/layout.tsx / frontend/src/shared/components/layout/MainLayoutClient.tsx (๋ฏธ์‚ฌ์šฉ)
  • SEVERITY: MEDIUM โ€” ๋ถ€๋ถ„ ํฌ๋ž˜์‹œ ์‹œ ์ „์ฒด ํ™”๋ฉด ๊นจ์ง (UX ์ €ํ•˜), ๊ธฐ์กด #61๊ณผ ๋ณด์™„์ 

Evidence

# File Line Finding Flagged By Confidence
1 frontend/src/shared/components/ErrorBoundary.tsx โ€” generic ErrorBoundary ์ปดํฌ๋„ŒํŠธ ์ •์˜ @code-review High
2 frontend/src/app/layout.tsx โ€” ErrorBoundary import / ์‚ฌ์šฉ ์—†์Œ @code-review High
3 frontend/src/shared/components/layout/MainLayoutClient.tsx โ€” ErrorBoundary import / ์‚ฌ์šฉ ์—†์Œ @code-review High
4 frontend/src/features/chat/components/ThreadErrorBoundary.tsx โ€” Thread ์ „์šฉ ErrorBoundary, ThreadContent ๋‚ด๋ถ€์—๋งŒ ์ ์šฉ @code-review High

์˜ํ–ฅ ๋ถ„์„

์˜ํ–ฅ ๋ฒ”์œ„

  • ์ฑ„ํŒ… ์™ธ ์˜์—ญ์˜ ๋ชจ๋“  client provider ํฌ๋ž˜์‹œ (Settings, AssistantConfig, AuthProvider ๋“ฑ)
  • StreamProvider ๋‚ด๋ถ€์˜ SSE ์ฒ˜๋ฆฌ ์—๋Ÿฌ
  • ๋ผ์šฐํŒ… ์ „ํ™˜ ์ค‘ ๋ฏธ์บ์น˜ ์—๋Ÿฌ

์žฅ์•  ์‹œ๋‚˜๋ฆฌ์˜ค

  1. ์‚ฌ์šฉ์ž ๋กœ๊ทธ์ธ ํ›„ chat ํŽ˜์ด์ง€ ์ ‘๊ทผ
  2. AssistantConfigProvider๊ฐ€ ์ž˜๋ชป๋œ ์‘๋‹ต์œผ๋กœ throw
  3. ThreadErrorBoundary ๋ฒ”์œ„ ์™ธ๋ถ€์ด๋ฏ€๋กœ ์ „ํŒŒ โ†’ React 16+ ๊ธฐ๋ณธ ๋™์ž‘์œผ๋กœ unmount ํ›„ white screen
  4. ์‚ฌ์šฉ์ž๋Š” ์ƒˆ๋กœ๊ณ ์นจ ์™ธ ๋ณต๊ตฌ ๋ถˆ๊ฐ€

๊ธด๊ธ‰๋„

  • ๊ธฐ์กด ์ด์Šˆ #61์ด Next.js์˜ error.tsx ๋ผ์šฐํŠธ boundary๋ฅผ ๋‹ค๋ฃธ โ€” ์ด๋Š” server/render ๋‹จ๊ณ„
  • ๋ณธ ์ด์Šˆ๋Š” React component-tree ๋ ˆ๋ฒจ์˜ client-side runtime ์—๋Ÿฌ๋ฅผ ๋‹ค๋ฃธ โ€” ์ƒ๋ณด์ , ๋‘˜ ๋‹ค ํ•„์š”

์ œ์•ˆ ํ•ด๊ฒฐ ๋ฐฉ์•ˆ

์ ‘๊ทผ ๋ฐฉ๋ฒ•

MainLayoutClient.tsx ๋˜๋Š” app/layout.tsx์—์„œ provider tree ์ „์ฒด๋ฅผ ErrorBoundary๋กœ ๊ฐ์‹ธ๊ธฐ:

// frontend/src/shared/components/layout/MainLayoutClient.tsx
import { ErrorBoundary } from \"@/shared/components/ErrorBoundary\";

export function MainLayoutClient({ children }: Props) {
  return (
    <ErrorBoundary
      fallback={(error) => <RootErrorFallback error={error} />}
      onError={(error, info) => {
        console.error(\"[root] uncaught\", error, info);
        // ์˜ต์…˜: Sentry, LogRocket ๋“ฑ ์™ธ๋ถ€ ๋ชจ๋‹ˆํ„ฐ๋ง ์ „์†ก
      }}
    >
      <SessionProvider>
        <AuthProvider>
          <SettingsProvider>
            <AssistantConfigProvider>
              {children}
            </AssistantConfigProvider>
          </SettingsProvider>
        </AuthProvider>
      </SessionProvider>
    </ErrorBoundary>
  );
}

RootErrorFallback์€ "์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค / ์ƒˆ๋กœ๊ณ ์นจ" ๋ฉ”์‹œ์ง€ + reload ๋ฒ„ํŠผ + ์—๋Ÿฌ ์ฝ”๋“œ ํ‘œ์‹œ.

๋Œ€์•ˆ

  • Next.js error.tsx๋งŒ ์‚ฌ์šฉ: ๊ธฐ์กด ๐ŸŸ [P1] fix(frontend): no error.tsx error boundaries in any app routeย #61 ํ•ด๊ฒฐ๋˜๋ฉด ์ผ๋ถ€ ์ปค๋ฒ„๋˜์ง€๋งŒ client runtime ์—๋Ÿฌ๋Š” ๋ณ„๊ฐœ
  • react-error-boundary ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋„์ž…: ๊ณต์‹ ๊ฐ€์ด๋“œ ์ž˜ ์ •๋ฆฌ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ, ์ž์ฒด ๊ตฌํ˜„ ๋Œ€์‹  ์‚ฌ์šฉ ๊ฐ€๋Šฅ

์ˆ˜์šฉ ๊ธฐ์ค€

  • MainLayoutClient.tsx์—์„œ ErrorBoundary๋กœ provider tree ๊ฐ์‹ธ๊ธฐ
  • ์˜๋„์  throw๋กœ fallback UI ๋™์ž‘ ๊ฒ€์ฆ
  • ์ƒˆ๋กœ๊ณ ์นจ ๋ฒ„ํŠผ ์ž‘๋™ ํ™•์ธ
  • ํ…Œ์ŠคํŠธ: cd frontend && pnpm test

์ฐธ์กฐ

์žฌํ˜„ ๋ฐฉ๋ฒ•

์‚ฌ์ „ ์กฐ๊ฑด

  • dev ์„œ๋ฒ„

๋‹จ๊ณ„

  1. AssistantConfigProvider์— ์˜๋„์  throw ์‚ฝ์ž… (ํ…Œ์ŠคํŠธ์šฉ)
  2. ํŽ˜์ด์ง€ ๋กœ๋“œ
  3. UI ์‘๋‹ต ํ™•์ธ

๊ธฐ๋Œ€ ๊ฒฐ๊ณผ

ErrorBoundary fallback UI ํ‘œ์‹œ

์‹ค์ œ ๊ฒฐ๊ณผ

React unmount โ†’ white screen, console์— uncaught error

๊ด€๋ จ ์ฝ”๋“œ ์ปจํ…์ŠคํŠธ

File Role Relevance
frontend/src/shared/components/ErrorBoundary.tsx Generic ErrorBoundary ์ปดํฌ๋„ŒํŠธ ํ™œ์šฉ ๋Œ€์ƒ
frontend/src/shared/components/layout/MainLayoutClient.tsx Client root layout ์ˆ˜์ • ๋Œ€์ƒ
frontend/src/features/chat/components/ThreadErrorBoundary.tsx Thread ์ „์šฉ boundary ์ฐธ๊ณ  ํŒจํ„ด

Detected by oh-my-braincrew `omb:issue` scan
Category: frontend | Scan date: 2026-04-16
`omb-issue-scan category=frontend checklist=ISS-UI-R8`

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:frontendfrontend domain scanomb-issue-scanDetected by omb:issue scanpriority:p2Medium โ€” fix if time permits

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions