Skip to content

Conversation

@goldegg127
Copy link
Contributor

πŸš€ ν’€ λ¦¬ν€˜μŠ€νŠΈ μ œμ•ˆ

πŸ“‹ μž‘μ—… λ‚΄μš©

#135 이슈 ν•΄κ²°

  • next jsμ—μ„œ μ§€μ›ν•˜λŠ” instrumentation 파일의 register ν•¨μˆ˜λ₯Ό μ‚¬μš©
  • register ν•¨μˆ˜λŠ” μ„œλ²„ μΈμŠ€ν„΄μŠ€κ°€ μ‹œμž‘λ  λ•Œ ν•œ 번만 μ‹€ν–‰λ©λ‹ˆλ‹€. μ„œλ²„κ°€ μ‹œμž‘λ  λ•Œ = κ°€μž₯ λΉ λ₯Έ μ‹œμ μ— msw μ‹€ν–‰ν•˜λ©΄μ„œ μ΅œμ ν™”

πŸ”§ λ³€κ²½ 사항

  • src/instumentaion.ts 파일 생성 및 register ν•¨μˆ˜ λ‚΄ msw 둜직 적용
    export async function register() {
      if (process.env.NEXT_RUNTIME === 'nodejs') {
        const { server } = await import('./lib/msw/server');
        server.listen();
      }
    }
  • layout.tsx 파일 λ‚΄ μ¦‰μ‹œμ‹€ν–‰ν•¨μˆ˜λ‘œ μ‹€ν–‰λ˜λŠ” msw 둜직 μ‚­μ œ
    (async () => {
      const { initMsw } = await import('../lib/msw');
      await initMsw();
    })();

πŸ“Έ μŠ€ν¬λ¦°μƒ·

μˆ˜μ •λœ ν™”λ©΄ λ˜λŠ” κΈ°λŠ₯을 μ‹œμ—°ν•  수 μžˆλŠ” μŠ€ν¬λ¦°μƒ·μ„ 첨뢀할 수 μžˆμŠ΅λ‹ˆλ‹€.

πŸ“„ 기타

Instumentation

msw 문제 ν•΄κ²° μ°Έκ³ 

@goldegg127 goldegg127 added the πŸ”§ fix μ½”λ“œμ—μ„œ 발견된 λ¬Έμ œλ‚˜ 버그λ₯Ό ν•΄κ²°ν•©λ‹ˆλ‹€ label Mar 21, 2025
@goldegg127 goldegg127 self-assigned this Mar 21, 2025
@auto-assign auto-assign bot requested review from bbjbc and vgotu99 March 21, 2025 14:34
@goldegg127 goldegg127 changed the title [πŸ”§ fix] MSW 졜초 λ Œλ”λ§ μ‹œ 500 문제 ν•΄κ²° #135 [πŸ”§ fix] MSW 졜초 λ Œλ”λ§ μ‹œ 500 문제 ν•΄κ²° Mar 21, 2025
Comment on lines +1 to +6
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
const { server } = await import('./lib/msw/server');
server.listen();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ§„μ§œ μ‹ κΈ°ν•˜λ„€μš”

Copy link
Contributor

@bbjbc bbjbc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

κ°“λ©˜ν† λ‹˜ μ§„μ§œ.

@goldegg127 goldegg127 merged commit d2ab273 into develop Mar 22, 2025
1 check passed
@goldegg127 goldegg127 deleted the fix/msw-500-error-135 branch March 22, 2025 07:12
@goldegg127 goldegg127 added 🐞 hotfix μ½”λ“œμ—μ„œ 발견된 치λͺ…적인 λ¬Έμ œλ‚˜ 버그λ₯Ό μ‹ μ†νžˆ ν•΄κ²°ν•©λ‹ˆλ‹€ and removed 🐞 hotfix μ½”λ“œμ—μ„œ 발견된 치λͺ…적인 λ¬Έμ œλ‚˜ 버그λ₯Ό μ‹ μ†νžˆ ν•΄κ²°ν•©λ‹ˆλ‹€ labels Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

πŸ”§ fix μ½”λ“œμ—μ„œ 발견된 λ¬Έμ œλ‚˜ 버그λ₯Ό ν•΄κ²°ν•©λ‹ˆλ‹€

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[πŸ”§ fix] MSW 졜초 λ Œλ”λ§ μ‹œ 500 문제 ν•΄κ²°

4 participants