Project knowledge for making this repo preview correctly from Vercel Devbox/Sandbox. Use when configuring Next.js dev settings, explaining how users preview the app from Devbox, or responding to localhost, Sandbox URL, port 3000, or cross-origin dev-resource issues.
npx skills add https://github.com/vercel-labs/nextjs-fastapi-chat-app-starter --skill devbox-preview
This starter is used in a workshop where some users run the app inside Vercel Devbox instead of on their laptop. Preserve this setup so preview works without users debugging Devbox internals.
The frontend must allow Vercel Sandbox preview origins during Next.js development. Keep this in frontend/next.config.js:
allowedDevOrigins: ["*.vercel.run"]
Without this, Next.js can serve the page but block dev-only resources such as HMR from https://sb-...vercel.run, causing confusing preview failures.
localhost means the remote box, not the user's laptop.https://sb-...vercel.run.http://localhost:3000.//api/*When explaining how to preview from Devbox, tell the user:
vercel dev -L --listen 0.0.0.0:3000
SANDBOX_ID=$(devbox get --output json | python3 -c 'import json, sys; print(json.load(sys.stdin)["response"]["devboxes"][0]["sandboxId"])')
sandbox config ports "$SANDBOX_ID" -p 3000
https://sb-...vercel.run URL printed by the sandbox config ports command.curl -i http://127.0.0.1:3000/ works inside Devbox but the browser fails, suspect Sandbox port publishing or allowedDevOrigins.frontend/next.config.js and restart vercel dev.vercel dev terminal logs.Take vercel-labs/devbox-preview from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.