Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .env.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Committed defaults, loaded last so anything already set wins.
#
# `.env` and `.env.local` are gitignored, so a default cannot live there; and
# `${PORT:-3002}` in a package script is not an option because Bun's own shell
# — which `bun run` uses on Windows — does not implement default-value
# parameter expansion and passes the literal through to Next.
#
# Precedence: shell PORT > .env.local > this file.

# Dev server port for apps/editor.
PORT=3002
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Google Maps API key (enables address search)
# NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_api_key

# Dev server port (default: 3000)
# PORT=3000
# Dev server port (default: 3002, set in .env.defaults)
# PORT=3002
2 changes: 1 addition & 1 deletion apps/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"private": true,
"scripts": {
"dev": "dotenv -e ../../.env.local -- next dev --port ${PORT:-3002}",
"dev": "dotenv -e ../../.env.local -e ../../.env.defaults -- next dev",
"build": "dotenv -e ../../.env.local -- next build",
"start": "next start",
"lint": "biome lint",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"scripts": {
"build": "turbo run build",
"dev": "set -a && . ./.env 2>/dev/null; set +a; turbo run dev --env-mode=loose",
"dev": "dotenv -e ./.env -e ./.env.defaults -- turbo run dev --env-mode=loose",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root defaults block local PORT

Medium Severity

The dev script loads .env.defaults via dotenv-cli before the editor application starts. This causes PORT values from .env.local to be ignored by the editor, as dotenv-cli does not override existing environment variables, breaking the intended precedence.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2f4a229. Configure here.

"lint": "biome lint",
"lint:fix": "biome lint --write",
"format": "biome format --write",
Expand Down
Loading