Skip to content

fix: 빌드 시점 환경변수 검증 오류 수정#64

Closed
Jieunsse wants to merge 1 commit into
mainfrom
feature/team-create-page
Closed

fix: 빌드 시점 환경변수 검증 오류 수정#64
Jieunsse wants to merge 1 commit into
mainfrom
feature/team-create-page

Conversation

@Jieunsse

Copy link
Copy Markdown
Contributor

Summary

모듈 로드 시 throw하던 환경변수 검증을 fetchApi 호출 시점으로 이동하여
.env 없는 환경에서도 pnpm build가 통과되도록 수정.

모듈 로드 시 throw하던 환경변수 검증을 fetchApi 호출 시점으로 이동하여
.env 없는 환경에서도 pnpm build가 통과되도록 수정.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Jieunsse Jieunsse added this to the 페이지 milestone Feb 22, 2026
@Jieunsse Jieunsse self-assigned this Feb 22, 2026
@Jieunsse Jieunsse added this to workers Feb 22, 2026
@Jieunsse Jieunsse added 오류수정 오류 및 에러 해결할 때 사용해주세요. 긴급 🔥 조속한 조치가 필요할 때 이용해주세요 labels Feb 22, 2026
@github-project-automation github-project-automation Bot moved this to 개발 대기중 in workers Feb 22, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Jieunsse, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 빌드 시점에 환경변수 유효성 검사로 인해 발생하던 오류를 해결합니다. 기존에는 NEXT_PUBLIC_API_BASE_URLNEXT_PUBLIC_API_TEAM_ID와 같은 환경변수가 모듈 로드 시점에 즉시 검증되어, .env 파일이 없는 환경에서는 빌드가 실패했습니다. 이번 변경으로 유효성 검사를 실제 API 호출이 발생하는 시점으로 지연시켜, 빌드 프로세스를 방해하지 않으면서도 필요한 시점에 환경변수 누락을 감지할 수 있도록 개선되었습니다.

Highlights

  • 환경변수 유효성 검사 시점 변경: 모듈 로드 시점에 발생하던 환경변수 유효성 검사를 실제 API 호출 시점으로 이동하여 빌드 프로세스의 유연성을 확보했습니다.
  • 빌드 성공률 개선: .env 파일이 없는 환경에서도 pnpm build 명령이 성공적으로 실행될 수 있도록 수정되었습니다.
  • API 설정 모듈 업데이트: src/shared/apis/config.ts 파일에서 BASE_URLTEAM_ID가 초기 로드 시 undefined를 허용하도록 변경되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/shared/apis/config.ts
    • 초기 모듈 로드 시 NEXT_PUBLIC_API_BASE_URLNEXT_PUBLIC_API_TEAM_ID에 대한 즉각적인 유효성 검사 로직을 제거했습니다.
    • BASE_URLTEAM_IDprocess.env에서 직접 내보내어 초기 값이 undefined일 수 있도록 허용했습니다.
  • src/shared/apis/fetchApi.ts
    • 상단에 선언되어 있던 NORMALIZED_BASE_URL 상수를 제거했습니다.
    • buildApiUrl 함수 내부에 BASE_URLTEAM_ID에 대한 유효성 검사 로직을 추가하여 실제 API 호출 시점에 검사가 이루어지도록 했습니다.
    • buildApiUrl 함수 내에서 normalizeBaseUrl을 사용하여 BASE_URL을 동적으로 정규화하도록 변경했습니다.
Activity
  • 아직 이 Pull Request에 대한 인간 활동은 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

이번 PR은 빌드 시점이 아닌 API 호출 시점에 환경 변수 유효성을 검사하도록 수정하여, .env 파일이 없는 환경에서도 빌드가 성공하도록 변경했습니다. 전반적으로 좋은 수정이며, 의도한 대로 잘 동작할 것으로 보입니다. 한 가지 개선 제안으로, 환경 변수 검증 로직에서 여러 변수가 누락되었을 경우 모든 누락된 변수를 한 번에 알려주도록 에러 메시지를 개선하는 것을 제안합니다. 이렇게 하면 설정 오류를 디버깅할 때 더 편리할 것입니다.

Comment on lines +17 to +18
if (!BASE_URL) throw new Error('NEXT_PUBLIC_API_BASE_URL is not defined.');
if (!TEAM_ID) throw new Error('NEXT_PUBLIC_API_TEAM_ID is not defined.');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

두 환경 변수를 각각 확인하는 대신, 한 번에 확인하여 누락된 모든 환경 변수를 에러 메시지에 포함시키는 것이 좋습니다. 이렇게 하면 설정 문제를 디버깅할 때 한 번에 모든 누락된 변수를 파악할 수 있어 더 효율적입니다.

  const missingVars: string[] = [];
  if (!BASE_URL) {
    missingVars.push('NEXT_PUBLIC_API_BASE_URL');
  }
  if (!TEAM_ID) {
    missingVars.push('NEXT_PUBLIC_API_TEAM_ID');
  }
  if (missingVars.length > 0) {
    throw new Error('Missing required environment variables: ' + missingVars.join(', '));
  }

@Jieunsse Jieunsse closed this Feb 22, 2026
@github-project-automation github-project-automation Bot moved this from 개발 대기중 to 개발 완료 in workers Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

긴급 🔥 조속한 조치가 필요할 때 이용해주세요 오류수정 오류 및 에러 해결할 때 사용해주세요.

Projects

Status: 개발 완료

Development

Successfully merging this pull request may close these issues.

1 participant