Skip to content

feat: Vercel Deploy Button 추가#161

Merged
egoing merged 3 commits into
mainfrom
issue-80
Mar 25, 2026
Merged

feat: Vercel Deploy Button 추가#161
egoing merged 3 commits into
mainfrom
issue-80

Conversation

@egoing

@egoing egoing commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • README.md에 Vercel Deploy Button 추가
  • Supabase Integration(oac_VqOgBHqhEoFTPzGkPd7L0iH6)을 통해 Supabase 환경변수(NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY) 자동 설정 및 supabase/migrations/ 마이그레이션 자동 실행
  • Uploadcare/OpenAI 키는 선택적 수동 입력으로 처리
  • vercel.json 수정 불필요 — Deploy Button URL 파라미터만으로 충분

Closes #80

Test plan

  • README.md의 Deploy with Vercel 버튼이 올바르게 렌더링되는지 확인
  • 버튼 클릭 시 Vercel 배포 페이지로 이동하는지 확인
  • Supabase Integration이 자동 연동 화면에 표시되는지 확인
  • 환경변수 입력 필드에 Uploadcare/OpenAI 키 입력란이 표시되는지 확인

🤖 Generated with Claude Code

Supabase Integration(oac_VqOgBHqhEoFTPzGkPd7L0iH6)을 통해
Supabase 환경변수 자동 설정 및 마이그레이션 자동 실행.
Uploadcare/OpenAI 키는 선택적 수동 입력.

#80

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@egoing

egoing commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author
image

uploadcare, openai key는 여기서 입력하지 말고, 나중에 사용자가 사용하는 타이밍에 입력을 요청하도록 변경

@egoing

egoing commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

604ba35e02c6c280.js:1 [🍉] [Loki] Initializing IndexedDB
352fd4778a49c405.js:1 Error: @supabase/ssr: Your project's URL and API key are required to create a Supabase client!

Check your Supabase project's API settings to find these values

https://supabase.com/dashboard/project/_/settings/api
at auth.debug (72e62cdd1ca27c23.js:37:54829)
at rO (72e62cdd1ca27c23.js:41:4915)
at a725e0fba0625c65.js:1:697
at ih (d0300bffb79131f2.js:1:95529)
at uf (d0300bffb79131f2.js:1:119379)
at uc (d0300bffb79131f2.js:1:119041)
at uf (d0300bffb79131f2.js:1:119424)
at uc (d0300bffb79131f2.js:1:119041)
at uf (d0300bffb79131f2.js:1:119424)
at uc (d0300bffb79131f2.js:1:119041)
f @ 352fd4778a49c405.js:1
3b9f849fb7f1e25b.js:1 Global error: Error: @supabase/ssr: Your project's URL and API key are required to create a Supabase client!

Check your Supabase project's API settings to find these values

https://supabase.com/dashboard/project/_/settings/api
at auth.debug (72e62cdd1ca27c23.js:37:54829)
at rO (72e62cdd1ca27c23.js:41:4915)
at a725e0fba0625c65.js:1:697
at ih (d0300bffb79131f2.js:1:95529)
at uf (d0300bffb79131f2.js:1:119379)
at uc (d0300bffb79131f2.js:1:119041)
at uf (d0300bffb79131f2.js:1:119424)
at uc (d0300bffb79131f2.js:1:119041)
at uf (d0300bffb79131f2.js:1:119424)
at uc (d0300bffb79131f2.js:1:119041)
(anonymous) @ 3b9f849fb7f1e25b.js:1
604ba35e02c6c280.js:1 [🍉] [Loki] Database loaded

Application error: a client-side exception has occurred (see the browser console for more information).

2026-03-25 09:53:57.939 [error] Middleware error: [Error: Your project's URL and Key are required to create a Supabase client!

Check your Supabase project's API settings to find these values

https://supabase.com/dashboard/project/_/settings/api]

2026-03-25 09:53:58.654 [error] Error: @supabase/ssr: Your project's URL and API key are required to create a Supabase client!

Check your Supabase project's API settings to find these values

https://supabase.com/dashboard/project/_/settings/api
at (https://supabase.com/dashboard/project/_/settings/api)
at auth.debug (.next/server/chunks/ssr/a393b403..js:37:51262)
at ck (.next/server/chunks/ssr/a393b403..js:41:4764)
at i (.next/server/chunks/ssr/app_(ui)error_page_tsx_8b19fcc7..js:1:291) {
digest: '4252957268'
}

앱을 실행했을 때 위와 같은 오류가 발생함.

- Deploy URL에서 Uploadcare/OpenAI 환경변수 입력 단계 제거
- next.config.js에 Supabase 환경변수 매핑 추가
  (SUPABASE_URL → NEXT_PUBLIC_SUPABASE_URL)
  (SUPABASE_PUBLISHABLE_KEY → NEXT_PUBLIC_SUPABASE_ANON_KEY)

#80

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@egoing

egoing commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author
image image

2026-03-25 12:19:15.010 [error] Error: @supabase/ssr: Your project's URL and API key are required to create a Supabase client!

Check your Supabase project's API settings to find these values

https://supabase.com/dashboard/project/_/settings/api
at (https://supabase.com/dashboard/project/_/settings/api)
at auth.debug (.next/server/chunks/ssr/a393b403..js:37:51262)
at ck (.next/server/chunks/ssr/a393b403..js:41:4764)
at i (.next/server/chunks/ssr/app_(ui)error_page_tsx_8b19fcc7..js:1:291) {
digest: '4252957268'
}

2026-03-25 12:19:14.925 [error] Middleware error: [Error: Your project's URL and Key are required to create a Supabase client!

Check your Supabase project's API settings to find these values

https://supabase.com/dashboard/project/_/settings/api]

여전히 오류가 발생합니다. deploy 에서 add integrations에서 supabase add를 했음에도 자동으로 supabase의 환경변수가 vercel project에 주입되지 않고 있는 것 같습니다.

When deploying via Vercel Deploy Button, Supabase Integration may not
be connected yet, leaving env vars unset. Previously the app crashed
with "@supabase/ssr: Your project's URL and API key are required".

- Add supabase/utils/config.ts with shared env var check helpers
- middleware.ts: skip updateSession when Supabase is not configured
- client.ts, server.ts, super.ts: throw descriptive error instead of
  passing undefined via non-null assertion
- Add unit tests for config helpers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@egoing

egoing commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

Supabase 환경변수 미설정 시 크래시 방지 수정 완료

변경 내용

문제: Vercel Deploy Button으로 배포 후 Supabase Integration이 연결되지 않은 상태에서 앱이 크래시

Error: @supabase/ssr: Your project's URL and API key are required to create a Supabase client!

원인: 모든 Supabase 클라이언트 생성 코드에서 process.env.NEXT_PUBLIC_SUPABASE_URL! (non-null assertion)을 사용하여 undefined를 Supabase SDK에 전달

수정:

파일 변경
supabase/utils/config.ts 신규 - 환경변수 체크 공통 헬퍼 (getSupabaseConfig, isSupabaseConfigured)
supabase/utils/middleware.ts 환경변수 미설정 시 updateSession을 건너뛰고 요청을 그대로 통과
supabase/utils/client.ts non-null assertion 제거, 미설정 시 명확한 에러 메시지
supabase/utils/server.ts 동일 처리
supabase/utils/super.ts 동일 처리 (SERVICE_ROLE_KEY 포함)
supabase/utils/__tests__/config.test.ts 신규 - 8개 테스트 케이스 (전체 통과)

동작 방식:

  • 미들웨어: Supabase 미설정 → 세션 처리 건너뜀 → NextResponse.next() 반환 (크래시 없음)
  • 클라이언트/서버: Supabase 미설정 상태에서 호출 시 → 명확한 에러 메시지 ("Supabase is not configured. Please set ...")
  • next.config.js의 env 매핑: 유지 (SUPABASE_URLNEXT_PUBLIC_SUPABASE_URL)

테스트 결과

  • ✅ Jest 단위 테스트 8개 통과
  • ✅ TypeScript 타입 체크 통과
  • ✅ Prettier 포맷팅 완료

@egoing

egoing commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

🔍 Supabase Vercel Integration 환경변수 미주입 문제 조사 결과

결론: 알려진 버그입니다

이 문제는 Supabase GitHub에 정식으로 등록된 버그이며, 다수의 사용자가 동일한 현상을 보고하고 있습니다. 의도된 동작이 아닙니다.


관련 이슈/토론

출처 내용
supabase#18163 Integration이 추가 프로젝트 연결 시 환경변수를 주입하지 않는 버그
supabase#18172 가장 관련 높음 — 이미 Integration이 설치된 조직에서 Deploy Button 사용 시 동작하지 않는 리그레션
supabase/discussions#20751 연결 후 시간이 지나면 환경변수가 사라지는 현상
Vercel Community Integration 자체가 깨져서 환경변수가 누락되는 보고
Vercel Community 기존 계정에서 Integration 설치 시 기존 프로젝트 연결 불가

문제 발생 조건

  1. 이미 Supabase Integration이 설치된 Vercel 팀/계정에서 Deploy Button으로 새 프로젝트를 배포하는 경우 ← 이번 케이스
  2. 하나의 Integration에 여러 Vercel 프로젝트를 연결하는 경우 (첫 번째만 성공)
  3. Integration 연결 후 시간이 지나면 변수가 사라지는 경우 (간헐적)
  4. 409 Conflict "already_installed" 에러로 재설치 불가한 경우

회피 방법 (권장순)

방법 1: 환경변수 수동 설정 (가장 안정적)

  • Supabase Dashboard > Project Settings > API에서 URL/키 확인
  • Vercel Dashboard > Project > Settings > Environment Variables에서 수동 입력
  • Integration에 의존하지 않으므로 가장 확실함

방법 2: Deploy Button URL에 env 파라미터로 명시적 입력 요구

  • Integration 동작 여부와 무관하게, 사용자가 배포 시 직접 값을 입력하도록 설정
  • 단점: 사용자 경험이 다소 번거로움

방법 3: 기존 Integration 완전 삭제 후 재설치

  • Vercel Settings > Integrations에서 Supabase 삭제
  • Supabase Dashboard에서도 Vercel 연동 해제 확인
  • 주의: 같은 계정의 다른 프로젝트 환경변수에도 영향을 줄 수 있음

방법 4: 환경변수 이름 매핑 확인

  • Supabase Integration이 주입하는 변수 이름: SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY
  • 프로젝트가 사용하는 이름: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY
  • Supabase Dashboard의 Vercel Integration 설정에서 framework-specific prefixes 옵션이 활성화되어 있는지 확인 필요
  • 또한 Supabase가 최근 ANON_KEYPUBLISHABLE_KEY로 이름을 변경하는 추세이므로 (#38984), next.config.js의 env 매핑이 중요

이 프로젝트에 대한 권장 사항

현재 PR #161에서 next.config.js의 env 매핑(SUPABASE_URLNEXT_PUBLIC_SUPABASE_URL)은 올바른 접근입니다. 추가로:

  1. README의 Deploy 가이드에 "Integration이 환경변수를 자동 설정하지 못하는 경우" 트러블슈팅 섹션 추가 — 수동 설정 방법 안내
  2. supabase/utils/config.ts의 환경변수 미설정 시 안전 처리 유지 — Integration 실패 시에도 앱이 크래시하지 않도록

이 조사는 /auto-issues 스킬에 의해 자동으로 수행되었습니다.

@egoing egoing merged commit 71dce6f into main Mar 25, 2026
2 of 3 checks passed
@egoing egoing deleted the issue-80 branch March 25, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Vercel Deploy Button 설정 및 환경변수 가이드 추가

1 participant