Skip to content

fix: .env.example のベースパスを next.config.js が読む BASE_PATH に合わせる - #638

Open
mekoand wants to merge 1 commit into
tegnike:developfrom
mekoand:fix/env-base-path
Open

mekoand wants to merge 1 commit into
tegnike:developfrom
mekoand:fix/env-base-path

Conversation

@mekoand

@mekoand mekoand commented Nov 18, 2026 •

Copy link
Copy Markdown

概要

.env.example のサブパス公開の項目が NEXT_PUBLIC_BASE_PATH になっていますが、next.config.js が読むのは BASE_PATH です。

assetPrefix: process.env.BASE_PATH || '',
basePath: process.env.BASE_PATH || '',
env: { NEXT_PUBLIC_BASE_PATH: process.env.BASE_PATH || '' },

.env.example のとおりに NEXT_PUBLIC_BASE_PATH を設定しても basePath と assetPrefix が設定されず、サブパスで公開できません。LivLiv Player 対応(#639)の作業中に気づきました。

変更内容

  • .env.example: NEXT_PUBLIC_BASE_PATH="" を BASE_PATH="" に変更
  • envExampleConsistency.test.ts: NEXT_PUBLIC_BASE_PATH は next.config.js が BASE_PATH から作るため、.env.example になくてもよい変数として扱う

確認

  • npm test: 220 suites / 2399 passed, 7 skipped
  • typecheck、ESLint、Prettier: 問題なし

ご確認よろしくお願いいたします。

meko

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 設定変更

    • GitHub Pagesなどでサブパス公開する際のベースパス設定に、BASE_PATHを使用するよう変更しました。
  • テスト

    • 自動生成される環境変数を、設定例の不足チェックで考慮するよう更新しました。

next.config.js は BASE_PATH から basePath / assetPrefix を設定し、クライアント用の NEXT_PUBLIC_BASE_PATH を生成する。
.env.example の NEXT_PUBLIC_BASE_PATH を設定してもサブパス公開にならなかったため、BASE_PATH に置き換える。
NEXT_PUBLIC_BASE_PATH は next.config.js が生成するため、.env.example との整合性テストの対象から外す。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

ベースパス設定の環境変数名を NEXT_PUBLIC_BASE_PATH から BASE_PATH に変更しました。整合性テストでは、Next.jsが生成する NEXT_PUBLIC_BASE_PATH を不足変数の判定から除外します。

Changes

ベースパス設定

Layer / File(s) Summary
変数名と整合性テスト
.env.example, src/__tests__/features/stores/envExampleConsistency.test.ts
.env.example の設定変数名を BASE_PATH に変更しました。テストでは、NEXT_PUBLIC_BASE_PATH をNext.jsが生成する変数として扱い、不足変数の判定から除外します。

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: tegnike

Merge Risk: Minimal · up to 05b7e

This updates the sample environment file so subpath deployments use the variable that the configuration actually reads. It has no runtime impact on code paths and is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed PR タイトルは、.env.example のベースパス変数を next.config.js が読む BASE_PATH に合わせる変更を具体的に示しています。変更内容の .env.example の変数名変更(NEXT_PUBLIC_BASE_PATH から BASE_PATH へ)と一致します。テストの除外対象の追加は主要な変更ではないため、タイトルに含まれていなくても…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

PR タイトルは、.env.example のベースパス変数を next.config.js が読む BASE_PATH に合わせる変更を具体的に示しています。変更内容の .env.example の変数名変更(NEXT_PUBLIC_BASE_PATH から BASE_PATH へ)と一致します。テストの除外対象の追加は主要な変更ではないため、タイトルに含まれていなくても問題ありません。

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5c20a6a2-016a-42a5-8343-e3acd5fe885f
Commits

Reviewing files that changed from the base of the PR and between f5b4144 and 05b7ee7.

Files selected for processing: 2

  • .env.example
  • src/__tests__/features/stores/envExampleConsistency.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

This branch has not been deployed

No deployments
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.

1 participant