apps/web preview overwrites newly built dist/index.html with stale dist/index.html.bak across builds
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript, vite
- Ambito
- build-system, tooling
Direzione di ricerca
Inizia con apps/web/package.json:8 (build) e apps/web/package.json:11 (preview), poi con apps/web/vite.config.ts:43 dove è impostato emptyOutDir: false; confronta gli script di build di apps/api/package.json e apps/gateway/package.json per il pattern di pulizia. Nota che turbo.json:11 mette in cache dist/**, per questo il .bak obsoleto sopravvive. Completato quando un secondo pnpm test:e2e dopo una modifica al codice serve i chunk con hash appena emessi, verificato ispezionando i tag <script> in apps/web/dist/index.html.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
apps/web/vite.config.ts:43 sets build.emptyOutDir: false, and apps/web/package.json:8 ("build": "tsc && NODE_ENV=production NODE_OPTIONS='--import=tsx' pnpm exec vite build") does not remove dist before building.
When pnpm test:e2e starts apps/web's preview script (apps/web/package.json:11):
env-cmd -f ../../.env -- pnpm exec import-meta-env -x .env.public -p dist/index.html && NODE_OPTIONS='--import=tsx' env-cmd -f ../../.env pnpm exec vite preview
@import-meta-env/cli saves a backup of dist/index.html to dist/index.html.bak on the first run and, whenever dist/index.html.bak already exists, reads dist/index.html.bak as its template and overwrites dist/index.html with it.
Because vite build has emptyOutDir: false:
- Subsequent
pnpm buildruns write a newdist/index.htmland new content-hasheddist/assets/*.jschunks, while leaving the olddist/index.html.bakand olddist/assets/*.jsfiles inapps/web/dist/. - Turbo caches
dist/**(turbo.json:11), including the staledist/index.html.bak. - On the next
pnpm test:e2erun,import-meta-envoverwrites the newly builtdist/index.htmlwith the staledist/index.html.bak, sovite previewserves the old hashed JS chunks from an earlier build or branch instead of the currentapps/webcode.
Reproduction
- Run
pnpm test:e2e(which createsapps/web/dist/index.html.bakviapnpm preview). - Change code in
apps/web(or switch branches) and runpnpm test:e2eagain withoutrm -rf apps/web/dist. - Inspect
apps/web/dist/index.htmlafterpnpm previewstarts: its<script>and<link rel="modulepreload">tags matchapps/web/dist/index.html.bakfrom step 1 rather than the newly emitted chunks from step 2.
Possible fix
Clean dist before vite build in apps/web/package.json (matching apps/api/package.json and apps/gateway/package.json, or enable emptyOutDir: true if runtime plugin ordering allows it) or remove dist/index.html.bak during apps/web build.
- Lingua principale
- TypeScript
- Stelle
- 119
- Fork
- 19
- Merge medio
- 1g 18h
- PR unite (30g)
- 60
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DouglasNeuroInformatics/OpenDataCapture
-
A docs change can fail pnpm check, because outreach lint and gen:types both write .astro/ at onceForse già presa @2389400626lh-ops l’ha presa oggi. ApertaArea: Infrastructure Area: Outreach Bug Difficulty: Low Good First Issue Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DouglasNeuroInformatics/OpenDataCapture#1956 ·
I maintainer di solito rispondono entro 1 giorno
-
Area: Infrastructure Chore Difficulty: Low Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
DouglasNeuroInformatics/OpenDataCapture#1948 ·
I maintainer di solito rispondono entro 1 giorno
-
Area: API Bug Difficulty: Low Priority: Low
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
DouglasNeuroInformatics/OpenDataCapture#1937 ·
I maintainer di solito rispondono entro 1 giorno
-
Area: Infrastructure Bug Difficulty: Low Priority: Medium Security
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
DouglasNeuroInformatics/OpenDataCapture#1916 ·
I maintainer di solito rispondono entro 1 giorno
-
Area: Infrastructure Chore Difficulty: Low Priority: Medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
DouglasNeuroInformatics/OpenDataCapture#1835 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di DouglasNeuroInformatics/OpenDataCapture
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
super-productivity/super-productivity#12128 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
`getClientCredentialsToken()` sends `scopes` (comma-joined) instead of the OAuth `scope` parameterAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
justyns/silverbullet-ai#199 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
spartan-ng/spartan#1931 ·
I maintainer di solito rispondono entro 2 giorni