Depuración de errores en apps con Lovable y Supabase
Clase 13 de 27 • Curso de lanzamiento y monetización de webs con Lovable
Resumen
Build with confidence: here’s a clear, hands-on way to debug errors using Lovable, chat mode, and Supabase. You’ll learn how to reroll to a working version, read edge function logs, use Chrome’s Developer Tools, and give specific context so fixes land fast.
How can you recover fast with rerolling and restore a working version?
Rerolling is a simple way to undo a breaking change and try another approach. If a new feature (like renaming photos) breaks everything, scroll up in the chat history, restore a previous working version, and prompt again with a different angle.
- Think “don’t get stuck in a rabbit hole.” Restore, then try a new prompt.
- Use the chat history to return to a stable state.
- Keep iterations focused and small.
Key vocabulary and ideas: - Rerolling: resetting to a working state and trying again. - Vibe Coding / Lovable: same reroll concept applies. - Working version: a known good snapshot to resume from.
How do you use chat mode as a debugging partner?
Chat mode is powerful, but not all-seeing. It needs specific context about what’s broken. Name the failing part, like an edge function, and ask targeted questions.
- Provide exact scope: “the photo renaming edge function is failing.”
- Ask: “Can you check the edge function logs to see errors for our photo renaming function?”
- Follow up: “Can you analyze the edge function and see if anything can be improved?”
- Expect a plan you can review and modify. Do a bit of detective work to validate the direction.
Useful behaviors mentioned: - Chat mode can scan your logs, edge functions, and front end to suggest fixes. - Sometimes it finds no explicit error, yet still proposes improvements (for example, large image size handling).
Key vocabulary and examples: - “Check the edge function logs”: ask chat mode to read logs and report errors. - “Analyze the edge function”: request a code review for improvements. - “Formulate a plan”: let it propose steps, then adjust as needed.
Where should you read Supabase logs and front-end errors?
Sometimes Lovable won’t see everything. Go straight to Supabase and Chrome’s Developer Tools to gather evidence you can paste back into chat mode.
How do you check Supabase edge function logs?
- In Supabase, open the Edge Functions section and select the specific function.
- Click Logs and set the filter to the last 24 hours to see all recent calls.
- Interpret the colors: successful runs show in blue/green. Past errors are listed below.
- If needed, copy the raw log as JSON and paste it into Lovable, so it can implement the fix.
- Note: sometimes Lovable may report “no log calls.” Cross-check in Supabase to confirm activity.
Keywords and examples: - Edge function, logs, filter: last 24 hours. - Copy as JSON: share raw details with Lovable. - Past issue example: no OpenAI credits caused errors.
How do you find front-end errors with Chrome Developer Tools?
- Right-click in Chrome and open Inspect.
- Go to Console to view messages and errors from client side and server side calls.
- Copy exact errors or messages and paste them into Lovable for targeted fixes.
Practical tips: - Be precise about what’s failing and where. - Share concrete logs, stack traces, or console messages. - Keep changes small and test after each fix.
If something here sparked an idea or you faced a similar error, share your case and the exact log or console message you’d like help with.