[General] I think the working tree is messing up the app.
- 主要语言
- 没有语言数据
- 星标
- 2.1k
- 派生
- 153
- PR 合并指标
- 30 天内没有已合并 PR
描述
**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) |
贡献指南
评估
这个 Issue 还没有评估数据。