Use prompts to debug apps in Rocket. Describe problems clearly, isolate issues, and fix them safely.
When something in your app is not working as expected, debugging means figuring out what is wrong and fixing it. In Rocket, you do this by explaining the problem clearly so the AI can help you fix it without starting over.This guide covers:
How to describe problems so they are easy to fix
Quick commands for common issues
How to make small, safe fixes instead of big rewrites
The best way to get help is to explain your problem clearly. Use this template:
Copy
1. What I expected: [Describe what should happen]2. What actually happened: [Describe what happens instead]3. Error message (if any): [Copy any error messages you see, or say "no error message"]4. Where this is happening: [Which page or part of your app]5. What I already tried: [List anything you already checked or changed]
Then ask Rocket to help:
Copy
Based on this information, explain what is most likely causing this issue.Then suggest a safe, minimal change to fix it.
1. What I expected: On the login page, when I enter my login information and click submit, I should go to the main dashboard page.2. What actually happened: I click submit, the button shows it is working for a moment, but then I stay on the login page. The page address does not change.3. Error message (if any): I see an error message that says: "Cannot read property 'userId' of undefined"4. Where this is happening: The login page5. What I already tried: - Checked that my login information is correct - Made sure the information is being saved - Tried opening in a different browser
Look for any error messages on the screen or in the browser.
If you see an error message, copy the exact text and use it in your problem description.
If you do not see an error message, move to the next step.
2
Check if something looks wrong
Compare what is on the page to what you expected.
If something looks wrong, describe what you expected and what you actually see.
If everything looks correct, move to the next step.
3
Check if nothing happens
If clicking buttons or interacting with the page does nothing at all:
Look more carefully for error messages you might have missed
Describe what should happen when you interact with the page
Describe what actually happens (nothing)
4
Write your message
Use the template from “How to describe problems” above to organize what you found. Include the error message, what looks wrong, or what does not respond.
The popup window opens correctly, but closing it does not work:- Clicking outside the popup does nothing- The "Cancel" button sometimes works, sometimes does notOnly fix how the popup closes:- Clicking the area behind the popup should close it- The "Cancel" button should always close it- Pressing the Escape key should close itDo not change how it looks or any other parts of the page.
Ask for an explanation first
Copy
This list is showing the same items twice, and sometimesit does not update when I add a new item.First, explain in simple terms what might be causing:- Why items appear twice- Why new items do not show upThen suggest a small change to fix both problems,and only make that change.
Something feels slow
Try /Fix Layout Issues first. Sometimes layout problems make pages feel slow. If that does not help:
Copy
This page feels slow when loading a lot of information.Check for things that might be making it slow:- The page refreshing when it does not need to- Loading the same information more than once- Loading too much information when the page first opensExplain what is making it slow, then suggest specific ways to make it faster.Do not change how it looks, just focus on making it work better.
Button does not work
Use @pages/profile.jsx to limit changes to one file, then describe the problem:
Copy
@pages/profile.jsx fix the submit button behavior. Check what happens when clicked and when form is submitted.On the "Save" button in the profile form, clicking it does nothing:- The button is visible and I can click it- Nothing happens when I click- No error message appears- The information does not saveDo not change how the form looks or how it is styled.
Information does not save
Use @pages/tasks.jsx to limit changes to one file:
Copy
@pages/tasks.jsx check whether the save function is being called and whether data is being sent correctly.When I update a task and click "Save", the changes show up temporarilybut disappear after I refresh the page. The information is not being savedto where it is stored.Check:- Whether the save function is being called- Whether the information is being sent to where it is stored correctly- Whether the response is being handled properlyFocus only on making sure information saves. Do not change how it looks.
Something does not show up
Use @pages/dashboard.jsx to limit changes to one file:
Copy
@pages/dashboard.jsx check whether the user list is set up correctly and whether data is being loaded properly.The user list does not show up on the dashboard page.The page loads, but the list area is empty even though there are usersstored in the system.Check:- Whether the list is set up and used correctly- Whether the information is being loaded properly- Whether there are any errors preventing it from showingDo not change other parts of the dashboard.
Here is how a vague message becomes a clear one.Bad (too vague):
Copy
The login is broken, please fix.
Does not say which page, does not explain what should happen, no error message or details.
Better (still needs work):
Copy
Login does not work after the user signs in.
Good (clear and actionable):First try /Fix Supabase Authentication Issues. If that does not work, use a detailed description:
Copy
1. What I expected: On the login page, when I enter my login information and click submit, I should go to the dashboard page.2. What actually happened: I click submit, the button shows it is working for a moment, then I stay on the login page. The page address does not change.3. Error message: I see an error message that says: "Cannot read property 'userId' of undefined"4. Where this is happening: The login page5. What I already tried: - Checked that my login information is correct - Made sure the information is being saved - Tried opening in a different browser - Tried /Fix Supabase Authentication Issues
Then follow up:
Copy
@pages/login.jsx based on this information, identify the most likely cause of the issueand propose a small, focused fix. Explain the change before applying it.
On the "Contact" form, clicking "Submit" does nothing:- Nothing happens when I click- No success or error message appears- No information is being sentHelp me fix only the submit button behavior.
Or even better: @pages/contact.jsx fix the submit button behavior. Nothing happens when clicked, no error appears, and no data is sent.
On the checkout page, the payment button shows it is working but never finishes.The form checks work correctly. Focus only on making the payment button work.
Or: @pages/checkout.jsx fix the payment button so it completes properly. The form validation works correctly.
Do not do this: “The table is not showing information.”
Instead:
Copy
The "Orders" table is empty even though there are orders stored in the system.The table layout looks correct, but no rows appear. Check how informationis loaded for this table.
On the "Orders" table, filtering by status works for"Pending" and "Completed", but selecting "Cancelled"shows an empty table even though there are cancelled ordersstored in the system.Focus on making filtering work for the "Cancelled" status.Do not change how the table looks or how it is styled.
If you have used the template above but Rocket keeps making changes that do not help:
Situation
What to try
Fix is completely wrong
Be more specific about the problem. Use the template structure.
Fix is partially right
Add more details about the problem. Include error messages and location.
Changed the wrong parts
Clearly state what NOT to change. Use @ to scope to one file.
Fix changes each time
Break the problem into smaller parts. Fix one issue at a time.
Ignores your existing work
Point to similar parts that work correctly. Show what you want it to look like.
If you are stuck, try explaining the problem to someone else in plain English. The words you use to explain it are often the words you should use in your message to Rocket.
These are the most frequent integration errors, along with what causes them and prompts to help fix them.
Supabase: RLS blocking queries
What happens: Your queries return empty results or you see “new row violates row-level security policy” errors, even though data exists in the table.Why: Row Level Security is enabled on the table but no policies have been created, or existing policies do not match the current user’s auth state.Fix prompt:
Copy
The [TABLE_NAME] table has RLS enabled but queries return empty results. Create RLS policies that allow authenticated users to read all rows and insert, update, or delete only their own rows (where user_id matches auth.uid()). Explain each policy you create.
Supabase: JWT token errors
What happens: You see errors like “JWT expired”, “invalid JWT”, or “no API key found in request” when making Supabase calls.Why: The Supabase client is not initialized correctly, the anon key is missing or wrong, or the user’s session token has expired and is not being refreshed.Fix prompt:
Copy
Supabase calls are failing with JWT token errors. Make sure the Supabase client uses SUPABASE_URL and SUPABASE_ANON_KEY from environment variables. Add automatic auth session refresh so expired tokens get renewed. If the session expires, redirect the user to the login page instead of showing a broken state.
Supabase: redirect URL mismatch
What happens: After social login (Google, GitHub), users see a “redirect URL mismatch” error or get stuck on a blank page instead of returning to the app.Why: The redirect URL configured in the Supabase dashboard does not match the URL your app is using, or localhost is not in the allowed list during development.Fix prompt:
Copy
Social login is failing with a redirect URL mismatch. Update the auth callback handler to use the correct redirect URL. For development, use http://localhost:[PORT]/auth/callback. Remind me to add this URL to the Supabase dashboard under Authentication > URL Configuration > Redirect URLs. Handle the auth callback properly by extracting the session from the URL hash.
Stripe: webhook not firing
What happens: Stripe checkout completes successfully, but your app never updates the order status or subscription because the webhook endpoint is not receiving events.Why: The webhook endpoint URL is incorrect, the webhook is not registered in the Stripe dashboard, or the endpoint is not publicly accessible during local development.Fix prompt:
Copy
Stripe webhooks are not reaching the app after checkout. Verify the webhook endpoint is correctly set up at /api/webhooks/stripe. Check that the endpoint parses the raw request body (not JSON-parsed) for signature verification. For local testing, remind me to use the Stripe CLI with `stripe listen --forward-to localhost:[PORT]/api/webhooks/stripe`. Log incoming webhook events for debugging.
Stripe: test vs. live key confusion
What happens: Payments fail with “No such product” or “Invalid API key” errors. Or test transactions appear in the live dashboard.Why: The app is using test keys (sk_test_…) with live products, or live keys (sk_live_…) with test products. Test and live environments are completely separate in Stripe.How to fix: Rocket cannot check your Stripe key values. Verify in your Stripe dashboard that you are using the correct test or live keys, then update them in the integration panel. Make sure product and price IDs were created in the same environment (test or live) as your keys.
Stripe: checkout redirect issues
What happens: After completing Stripe checkout, the user is not redirected back to the app. They stay on the Stripe page or see a broken link.Why: The success_url or cancel_url in the checkout session is incorrect, uses a relative path instead of an absolute URL, or the domain is not configured in Stripe settings.Fix prompt:
Copy
After Stripe checkout, users are not redirected back to the app. Update the success_url and cancel_url in the checkout session creation to use absolute URLs. Include the session_id query parameter so the success page can retrieve the session details.
Email: sender not verified
What happens: Emails fail to send with errors like “sender address not verified” or “domain not authenticated”.Why: The “from” email address or domain has not been verified in the email provider’s dashboard (Resend or SendGrid). Unverified senders are blocked to prevent spam.Fix prompt:
Copy
Email sending is failing because the sender is not verified. Update the "from" address to use a verified domain. For development with Resend, use "onboarding@resend.dev" as the sender. Remind me to verify my custom domain in the [Resend/SendGrid] dashboard by adding the required DNS records (SPF, DKIM, DMARC). Add error handling that logs the specific failure reason.
Email: going to spam
What happens: Emails are sent successfully (no errors) but recipients find them in their spam or junk folder instead of their inbox.Why: The sending domain lacks proper authentication records (SPF, DKIM, DMARC), the email content triggers spam filters, or the sender reputation is low.How to fix: This is a domain and DNS configuration issue, not a code issue. Add SPF, DKIM, and DMARC records provided by your email service (Resend or SendGrid) to your domain’s DNS settings. Use a recognizable “from” name and avoid spam trigger words in subject lines.
Email: missing API key
What happens: Email sending fails with “unauthorized”, “API key missing”, or “authentication failed” errors.Why: The API key environment variable is not set, is misspelled, or is not accessible in the current environment (for example, set on the server but accessed from the client).Fix prompt:
Copy
Email sending is failing. Make sure API calls happen on the server, not the client. For development, use "onboarding@resend.dev" as the sender. Add error handling that logs the specific failure reason.
AI: rate limit errors
What happens: AI API calls fail with “429 Too Many Requests” or “rate limit exceeded” errors, especially when multiple users trigger AI features at the same time.Why: The app is sending too many requests to the AI provider within their rate limit window. Free-tier API keys have stricter limits.Fix prompt:
Copy
AI API calls are hitting rate limits. Add these safeguards:- Debounce user-triggered AI calls so rapid clicks do not send multiple requests- Add a loading state that disables the button while a request is in progress- Implement exponential backoff retry (wait 1s, then 2s, then 4s) on 429 errors- Show a user-friendly message: "AI is busy, please try again in a moment"- Cache recent AI responses to avoid duplicate requests for the same input
AI: token limit exceeded
What happens: AI responses are cut off mid-sentence or you see “maximum context length exceeded” errors.Why: The input (prompt plus context) exceeds the model’s token limit. This often happens when sending entire pages or documents as context.Fix prompt:
Copy
AI calls are failing because the input exceeds the token limit. Fix this by:- Truncating the input text to a maximum of [MAX_CHARS] characters before sending- Show a warning if the user's input is too long: "Content is too long for AI processing. Only the first [MAX_CHARS] characters will be used."- If summarizing long content, split it into chunks, summarize each chunk, then combine the summaries- Use a model with a larger context window if available (e.g., gpt-4o instead of gpt-3.5-turbo)
AI: model not responding
What happens: The AI feature shows a permanent loading spinner. No response comes back and no error is displayed.Why: The API call has no timeout configured, the model name is misspelled, or the API endpoint URL is wrong. Network issues or provider outages can also cause this.Fix prompt:
Copy
The AI feature hangs with a loading spinner and never returns a result. Set a 30-second timeout on the API call. If it times out, show "AI is taking too long to respond. Please try again." Add a Cancel button that aborts the request. Log the full error details for debugging.
Deployment: build failure
What happens: The deployment fails during the build step with errors like “module not found”, “build command failed”, or TypeScript compilation errors.Why: Dependencies are missing, the build command is wrong, or there are code errors that only appear during a production build (like unused imports treated as errors).Fix prompt:
Copy
The deployment build is failing. Make sure all dependencies are listed in package.json. Fix any TypeScript errors or ESLint warnings that would cause a production build to fail. Verify all imported files and modules use correct case-sensitive paths.
Deployment: environment variable missing
What happens: The app builds and deploys, but features break in production. Database queries fail, payments do not work, or emails do not send.Why: Environment variables that exist locally (.env file) were not added to the deployment platform’s settings. The app runs without the required API keys and connection strings.Fix prompt:
Copy
The deployed app is missing environment variables, causing features to break. Create a .env.example file listing every environment variable the project needs, with placeholder values and comments. Include: SUPABASE_URL, SUPABASE_ANON_KEY, STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, [EMAIL_API_KEY], and any others found in the codebase. Add a startup validation check that logs which required variables are missing.
Deployment: custom domain not resolving
What happens: After setting up a custom domain, visiting it shows “site not found”, a DNS error, or the default hosting provider page instead of the app.Why: DNS records are not configured correctly, DNS changes have not propagated yet (can take up to 48 hours), or the domain is not linked to the correct project in the hosting dashboard.How to fix: This is a DNS and hosting configuration issue. In Netlify, verify your custom domain is listed under Domain Settings. Add the correct DNS records at your domain registrar (CNAME or A record). Wait up to 48 hours for propagation and check SSL/HTTPS provisioning. Use dnschecker.org to verify records. See Connect Custom Domain.