github / github/app

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

Đang mở
#366 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Bugs General
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
2.1k
Fork
153
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**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) |

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.