Repository navigation
Conversation
yf-1229
commented
Aug 1, 2026
Owner
- web/vite.config.ts: base: './' を設定 (Pages はサブパス /coBroc/ で配信されるため、絶対パス /assets/... が 404 になり main.ts 未実行 → 「Loading WASM module...」のまま白画面になっていた)
- web/e2e/run_e2e.mjs: E2E_BASE_PATH 環境変数でサブパス配信を再現可能に
- web/public/favicon.svg + index.html に favicon リンク追加(favicon 404 解消)
- 検証: サブパス /coBroc/ とルートの両方で E2E 全15項目パス(実WASMロード確認)
- web/vite.config.ts: base: './' を設定 (Pages はサブパス /coBroc/ で配信されるため、絶対パス /assets/... が 404 になり main.ts 未実行 → 「Loading WASM module...」のまま白画面になっていた) - web/e2e/run_e2e.mjs: E2E_BASE_PATH 環境変数でサブパス配信を再現可能に - web/public/favicon.svg + index.html に favicon リンク追加(favicon 404 解消) - 検証: サブパス /coBroc/ とルートの両方で E2E 全15項目パス(実WASMロード確認)
Contributor
There was a problem hiding this comment.
Pull request overview
GitHub Pages(/<repo>/ のサブパス配信)でビルド後アセットが 404 になり白画面になる問題を、Vite の base を相対化することで解消し、あわせて E2E でサブパス配信を再現できるようにするPRです。
Changes:
web/vite.config.tsにbase: './'を追加し、Pages 配信時のアセット参照をページ相対に変更web/e2e/run_e2e.mjsにE2E_BASE_PATH対応を追加し、/<repo>/配信をE2Eで再現可能に- favicon 404 対策として
favicon.svgを追加し、index.htmlから参照
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| web/vite.config.ts | GitHub Pages のサブパス配信でもアセットが解決できるよう base: './' を設定 |
| web/public/favicon.svg | SVG favicon を追加し、favicon 404 を解消 |
| web/index.html | 追加した favicon を参照するリンクタグを追加 |
| web/e2e/run_e2e.mjs | サブパス配信の再現用に E2E_BASE_PATH を導入し、E2E 実行URLを調整 |
| plan.md | 対応内容・原因・検証結果の記録を追記 |
Suppressed comments (1)
web/e2e/run_e2e.mjs:35
req.urlが未定義の場合にsplit()で例外になります。また、..を含むパスが来た場合にdist/خارجのファイルを読み取れてしまう可能性があります(パストラバーサル)。URL の既定値設定と、dist配下に収まることの検証を入れてください。
let urlPath = req.url.split('?')[0];
if (BASE_PATH && urlPath.startsWith(BASE_PATH)) {
urlPath = urlPath.slice(BASE_PATH.length);
}
let p = join(DIST, urlPath === '/' || urlPath === '' ? '/index.html' : urlPath);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
| const PORT = 17890; | ||
| const DIST = join(__dirname, '..', 'dist'); | ||
| const BASE_PATH = process.env.E2E_BASE_PATH || ''; // 例: '/coBroc' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.