
Configuring Dev Server Scripts
Before using the preview, you need to configure a dev server script. There are two ways to do this.Quick Setup from Preview Panel
If no dev server script is configured, the preview panel shows a setup prompt:
- Click Edit Dev Server Script
- Enter your dev server command (e.g.,
npm run dev) - Click Save or Save and Test to verify it works

From Repository Settings
Alternatively, configure scripts through the settings:Open Settings
Open the command bar (
Cmd/Ctrl + K) and select Settings, or click the settings icon () in the navbar.Configure Dev Server Script
Enter your dev server command in the Dev Server Script field:
You can also configure:
| Framework | Command |
|---|---|
| Vite | npm run dev |
| Next.js | npm run dev |
| Create React App | npm start |
| Yarn projects | yarn dev |
| PNPM projects | pnpm dev |
- Setup Script - Commands to run before starting (e.g.,
npm install) - Cleanup Script - Commands to run when workspace closes
For detailed setup including the Web Companion for component selection, see Testing Your Application.
Opening the Preview
- Click the Preview toggle () in the navbar
- Click the preview icon in the context bar
- Use the command bar:
Cmd/Ctrl + K→ “Toggle Preview Panel”
Starting the Dev Server
From the context bar:- Click the Play icon () to toggle the dev server
- Press
Cmd/Ctrl + K→ “Toggle Dev Server”
Device Modes

| Mode | Description |
|---|---|
| Desktop | Full-width browser view |
| Mobile | Mobile device dimensions |
| Custom | Set specific viewport width and height |
Multiple Dev Servers
For projects with multiple services:- Each dev server appears as a tab
- Switch between servers to view different parts of your application
- Logs are separated per server
Viewing Logs
The preview panel includes a log viewer:- View stdout/stderr from your dev server
- View Full Logs button for complete output
- Logs update in real-time
- Filter or search log content
Best Practices
- Start the dev server early in your task
- Keep the preview visible while the agent works
- Test changes incrementally
- Use device modes to verify responsive design
Troubleshooting
Preview shows blank page
Preview shows blank page
Possible causes:
- Dev server hasn’t finished starting
- Wrong URL being loaded
- Application has a JavaScript error
- Check the Logs panel for the dev server output - wait for “ready” or similar message
- Verify the correct URL is detected (shown in the preview address bar)
- Open browser DevTools (right-click → Inspect) to check for console errors
- Try refreshing the preview with the reload button
Preview doesn't update after changes
Preview doesn't update after changes
Possible causes:
- Hot reload isn’t working
- Build error preventing update
- Browser caching
- Check Logs panel for build errors
- Try a hard refresh (Cmd/Ctrl + Shift + R)
- Restart the dev server using the Play button
- Verify your framework supports hot module replacement (HMR)
'No dev server script configured' message
'No dev server script configured' message
What to do:
- Click Edit Dev Server Script in the preview panel
- Enter your dev server command (see table below)
- Click Save and Test
| Framework | Command |
|---|---|
| Vite | npm run dev or pnpm dev |
| Next.js | npm run dev |
| Create React App | npm start |
| Vue CLI | npm run serve |
| Angular | ng serve |
| Django | python manage.py runserver |
| Rails | rails server |
| Go | go run main.go |
Port conflict error
Port conflict error
What it means: Another process is using the same port your dev server wants.Solutions:
- Find and stop the conflicting process
- Change your dev server port in your project config
- Close other workspaces that might have dev servers running
- Run
lsof -i :3000(replace 3000 with your port) to find what’s using it
Preview works but assets/images don't load
Preview works but assets/images don't load
Possible causes:
- Relative paths not resolving correctly
- Assets served from wrong directory
- CORS issues
- Check that asset paths in your code are correct
- Verify your dev server is configured to serve static assets
- Check browser DevTools Network tab for failed requests
Related Documentation
- Changes Panel - Review code modifications
- Interface Guide - Overview of workspace panels
- Testing Your Application - Detailed testing workflows