-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
area/dockerDocker and containersDocker and containersdxDeveloper experience improvementsDeveloper experience improvementsenhancementNew feature or requestNew feature or requestpriority/highImportant for v1.0Important for v1.0
Description
Problem
When running light up (development mode), Traefik proxies https://app.lvh.me → http://host.docker.internal:3000, but most dev servers fail with Error 500 due to:
- Host binding: Vite/Nuxt/Next dev servers bind to
localhostby default (not accessible from Docker containers) - SSL certificate trust: Dev servers making requests to
https://api.lvh.medon't trust mkcert certificates
Current Workaround
Users must manually update their dev script:
{
"dev": "NODE_EXTRA_CA_CERTS=\"$(mkcert -CAROOT)/rootCA.pem\" nuxt dev --host"
}This requires users to:
- Know about the
--hostflag for their framework - Know about mkcert root CA location
- Manually configure each project
Proposed Solution (Option B + light dev wrapper)
Interactive Setup During light init
Detect dev script and offer to update it:
✓ Lightstack project 'playground' initialized
⚠️ Dev server configuration needed:
Your "dev" script may not be accessible from Traefik proxy.
Current: "nuxt dev"
Suggested: "NODE_EXTRA_CA_CERTS=\"$(mkcert -CAROOT)/rootCA.pem\" nuxt dev --host"
Update package.json? [Y/n]
Alternative: light dev Wrapper Command
Provide light dev command that wraps user's dev server with correct configuration:
- Auto-detects framework (Nuxt, Vite, Next, etc.)
- Adds
--hostflag - Sets
NODE_EXTRA_CA_CERTSto mkcert root CA - Executes user's dev command with proper env vars
Update "Next steps" output:
Next steps:
Start your app: light dev
(Or manually: bun dev --host with mkcert CA trusted)
Hybrid Approach (Recommended)
- During
light init: Offer to updatedevscript interactively - Provide
light dev: As fallback for users who decline the update - Document in output: Show troubleshooting tips if users use manual
bun dev
User Preference
Users prefer Option B (interactive update) because:
- Most devs will instinctively run
<package-manager> run dev(muscle memory) - Remembering to use
light devis extra cognitive load across many projects - Interactive fix during init is one-time setup, then forgotten
Framework Detection Needed
Need to detect and support:
- Nuxt:
nuxt dev --host - Vite:
vite --host - Next.js: Next binds to
0.0.0.0by default, but may need SSL trust - Express/Fastify/etc: Custom server configurations
Success Criteria
- User runs
light init→ interactive prompt to fix dev script - User runs
bun dev→ app accessible viahttps://app.lvh.me(no Error 500) - Dev server can make requests to
https://api.lvh.me(mkcert CA trusted) -
light devwrapper command available as alternative - Clear documentation in troubleshooting guide
Related
- Spec 002 (development mode implementation)
- Issue Create console output formatting system #7 (console output formatting - could improve the interactive prompts)
Metadata
Metadata
Assignees
Labels
area/dockerDocker and containersDocker and containersdxDeveloper experience improvementsDeveloper experience improvementsenhancementNew feature or requestNew feature or requestpriority/highImportant for v1.0Important for v1.0