github / github/app

[General] I think the working tree is messing up the app.

Abierto
#366 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Bugs General
Lenguaje dominante
Sin datos de lenguaje
Estrellas
2.1k
Forks
153
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Mood:** 😢
**Category:** Bugs

I think the working tree is messing up the app.

The presence of the extra folder is making the .enve variable inaccessible:

/Users/engineersticity/copilot-worktrees/my-app/engineersticity-miniature-winner
~/c/s/engineersticity-miniature-winner engineersticity/fix-hydration !1

How do we fix that. This is a monorepo. Rem??
I’m checking where env files are expected in this monorepo and whether this worktree actually has the local .env files present.
I’ve confirmed the local env files are gitignored here, so I’m checking how the web app reads them before I tell you the safest fix.
It’s not the extra folder depth. The issue is that a Git worktree is a separate checkout, and your local env files are gitignored, so they do not come along automatically.

I confirmed:

.gitignore ignores **/.env.local
the web apps read env from process.env in app-local code (apps/web-shop/src/lib/firebase/client.ts, apps/web-admin/src/lib/firebase/client.ts)
there is no .env.local present in this worktree
So in this worktree, Next sees no Firebase env and falls back to “not configured”.

Fix now

Put the env files inside this worktree:

Bash
cp /path/to/your/real/web-shop.env.local apps/web-shop/.env.local
cp /path/to/your/real/web-admin.env.local apps/web-admin/.env.local
or, if you already have them in the main checkout:

Bash
cp /Users/engineersticity/my-app/apps/web-shop/.env.local apps/web-shop/.env.local
cp /Users/engineersticity/my-app/apps/web-admin/.env.local apps/web-admin/.env.local
Restart the dev servers.

Better monorepo/worktree-safe setup

Best: keep secrets outside the repo and symlink them into each worktree:
Bash
ln -s ~/secrets/spar/web-shop.env.local apps/web-shop/.env.local
ln -s ~/secrets/spar/web-admin.env.local apps/web-admin/.env.local
Also good: use direnv or shell exports from repo root before starting Next.
Don’t rely on a repo-root .env.local for these apps; this repo is set up to use app-local env files.
Important: worktrees share Git history, not your ignored local files. So every new worktree needs its own .env.local files, copies, or symlinks.

---
| Field | Value |
| --- | --- |
| App version | 0.2.8 |
| OS | macOS 26.5.0 |
| Theme | GitHub |
| Path | /chat |
| Tenure | Day 2 (Week 1) |

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.