Coding prompts · Prompt
Debug a frontend SPA (prompt)
debug-frontend-spa-prompt
A prompt that finds a client-side fault in a single-page app, such as a blank screen, a bad route, or a Vite, React or Angular error. Use when the user pastes an SPA error, a white screen after deploy, or a browser-only bug.
Works with: Any AI Not yet model-tested; testing Jan 2027
Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works
Install in Claude Code, Cursor or Codex (optional)
Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.
Claude Code (all your projects)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/debug-frontend-spa-prompt/raw' -o ~/'.claude/skills/debug-frontend-spa-prompt/SKILL.md'Cursor (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/debug-frontend-spa-prompt/raw' -o '.cursor/skills/debug-frontend-spa-prompt/SKILL.md'Codex and other Agent Skills tools (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/debug-frontend-spa-prompt/raw' -o '.agents/skills/debug-frontend-spa-prompt/SKILL.md'
Or connect the whole library over MCP
Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):
{
"mcpServers": {
"theskillvault": {
"url": "https://theskillvault.ai/mcp"
}
}
}This prompt debugs a single-page app in the browser. It does not assume a server is there to blame.
When to use
- A React, Angular or Vite app shows a blank screen or a white screen.
- A route fails only after the SPA is deployed.
- The user pasted a browser error and the fault looks client-side.
When not to use
- You want a method for any bug in any layer. Use debug-systematically.
- You want Chrome DevTools driven for you. Use debug-with-chrome-devtools.
- The console says hydration failed. Use fix-react-hydration-errors.
- The browser reports a CORS header. Use debug-cors-errors.
Steps
- Paste the error text, the framework and where it is hosted.
- Remove cookies, tokens and private URLs first.
- Run the checks in order. Stop when one check explains the screen.
- Apply one change, then reload. Do not stack fixes.
Prompt
Debug this single-page app as a client-side fault. Do not assume a backend exists.
PROBLEM:
{{WHAT THE SCREEN DOES}}
FRAMEWORK:
{{ANGULAR, REACT, VITE, OR OTHER}}
HOST:
{{VERCEL, NETLIFY, GITHUB PAGES, OR OTHER}}
ERROR TEXT:
{{CONSOLE OR BUILD TEXT}}
Write these sections only:
# Problem analysis
What the screen is doing, in two or three sentences. Quote the error if one was pasted.
# Likely cause
The single most likely client-side cause, and one sentence on why.
If the text is a hydration mismatch or a CORS header, name that and stop.
If the notes are too thin, write "not enough to name a cause".
# Checks to run
Three to six checks, in order. Each check says what you look at and what result would confirm the cause.
Prefer the route base path, the built asset URL, the env value baked at build time, and a stale cache.
Do not invent a stack frame, a config key or a file that was not in the notes.
# How to prevent it
Two short practices that would catch this before the next deploy.
Rules:
- Client-side only. Do not propose a server rewrite.
- If no framework is named, say which assumption you used.
- Plain words. One check is one sentence.
How to adapt
- Svelte, Vue or another framework? Keep the same four sections. Swap the framework name.
- A static host other than the ones listed? Put its name under HOST.
Gotchas
- Do not paste API keys, session cookies or passwords into a public AI.
- A blank screen can be a 404 on one script. Check the network row before you edit code.
- Several changes at once hide which check mattered.
Portability
Works with any AI chat. Angular, React, Vite, or another framework, on any host.
Done when
- The cause is one client-side sentence, or the note says the evidence is too thin.
- The checks can be run in the browser without a backend.
- Hydration and CORS were named and stopped, when the error text is one of those.
Example prompt
"Debug this Vite React SPA. The production site is a white screen. The console says the main script 404s. Hosted on Netlify."
---
Adapted from the "Senior Frontend Debugger for SPA Websites (Angular, React, Vite)" prompt by ovulgo22 on prompts.chat (CC0 1.0, public domain).
Licence
Adapted from ovulgo22 (prompts.chat) (Public domain (CC0 1.0) - prompt contributed to prompts.chat by ovulgo22. Upstream title: Senior Frontend Debugger for SPA Websites (Angular, React, Vite).), CC0 1.0. Adapted by TheSkillVault: kept client-side SPA debugging for Angular, React and Vite, with analysis, cause, checks and prevention; dropped the assumption of a backend; added a stop for hydration and CORS, steps and done-when.
Licence: CC0 1.0. Attribution when you reuse it: Based on work by ovulgo22 (prompts.chat) (Public domain (CC0 1.0) - prompt contributed to prompts.chat by ovulgo22. Upstream title: Senior Frontend Debugger for SPA Websites (Angular, React, Vite)., CC0 1.0), https://github.com/f/prompts.chat/blob/b09880e229d2f091ffa2254bc187532fb8980f9b/prompts.csv; adapted by TheSkillVault, https://theskillvault.ai