Studio: files added to `public/` return 404 until the project is reopened, when `public/` did not exist at open
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript, vite
- 領域
- devtools
調査の方向性
packages/studio/src/start-studio.ts から始めてください。ここでは publicDir が Vite の createServer に渡されています。packages/studio/src/scaffold-project.ts では src/ を public/ なしで書き出しています。再現手順は、public/ のないプロジェクトを開き、そこにファイルを追加して、/audio/x.wav にリクエストすることです。404 が返るはずです。完了条件は、プロジェクトを開き直さずにファイルが配信されること、そして scaffold が public/ を作成することです。
索引モデルが issue の本文から書いたものです。
説明
Summary
If a project has no public/ directory when Studio opens it, files added to public/ afterwards are never served. The assets panel lists them, but the dev server answers 404 for every one, so <Audio> plays silence and images and fonts are missing, with no error anywhere. It stays that way until the project is closed and opened again.
Every project created from Studio's workspace picker starts in this state, because the scaffold writes src/ and no public/.
Reproduction
Studio 0.2.6 (rendiv studio --workspace /workspace --port 3000 --host 0.0.0.0, Linux in Docker, Vite 6.4.1).
- Create a project from the workspace picker and leave it open.
mkdir -p public/audio && cp x.wav public/audio/GET /__rendiv_api__/assets/listlistsaudio/x.wav.GET /audio/x.wavreturns 404.- A file written later, straight into the
public/that now exists, returns 404 too. POST /__rendiv_api__/workspace/back, thenPOST /__rendiv_api__/workspace/openwith the same project path. Every file from steps 2 to 4 now returns 200, and from here on a new file inpublic/is served within a couple of seconds.
Cause
packages/studio/src/start-studio.ts passes publicDir: path.resolve(cwd, publicDir) to createServer. Vite reads the public file list once at startup (an empty set when the directory is missing), and servePublicMiddleware only serves paths that are in that set. The set should grow from the watcher's add events, but when the directory did not exist at startup it never does. --host turns on usePolling, which may be part of it; I did not trace it further into chokidar.
Suggested fix
- In
startStudio, create the directory beforecreateServer(fs.mkdirSync(path.resolve(cwd, publicDir), { recursive: true })). It already creates.studio/there. - In
packages/studio/src/scaffold-project.ts, createpublic/next tosrc/, and add it to thecreate-rendivtemplate as well (for example with a.gitkeep).
- 主要言語
- TypeScript
- スター
- 159
- フォーク
- 32
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
thecodacus/rendiv のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
thecodacus/rendiv#17 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
thecodacus/rendiv#15 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
thecodacus/rendiv#24 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
thecodacus/rendiv#23 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
thecodacus/rendiv#22 ·
thecodacus/rendiv の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
"Claude Code request is missing its initial user message" when the prompt starts with an image pathオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
earendil-works/pi-claude-code#31 ·
メンテナーはふだん 8 日以内に返信
-
bug pending triage
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
privatenumber/cleye#48 ·
-
Google text documents are base64-encoded twice対応中かも @feiiiiii5 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信