[General] I think the working tree is messing up the app.
- Dominant language
- No language data
- Stars
- 2.1k
- Forks
- 153
- PR merge metrics
- No merged PRs in 30d
Description
**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) |
Contributor guide
Assessment
This issue has not been assessed yet.