What Breaks
The CLI handles the mechanical transformation, but some Lovable-specific patterns require manual fixes. Here’s what to watch for.Hardcoded API Calls
Lovable-Managed Endpoints
Lovable apps often have hardcoded references to Lovable’s managed backend:Supabase Client Configuration
Environment Variables
Lovable-Specific Variables
Lovable injects environment variables at build time that won’t exist in your Next.js app:.env.local:
Prefix changes:
- Vite uses
VITE_prefix - Next.js uses
NEXT_PUBLIC_prefix for client-side env vars
Missing Environment Variables
After conversion, your app won’t have access to Lovable’s injected variables. You’ll need to:- Create
.env.localfile - Add your Supabase credentials
- Update any hardcoded URLs
- Restart dev server
Route Structure Changes
React Router → Next.js App Router
The CLI converts React Router patterns, but you need to understand the new structure:app/ directory
Route Parameters
Data Fetching Patterns
Client-Side Fetching in useEffect
Realtime Subscriptions
Authentication Patterns
Client-Side Auth State
Database Queries
Hardcoded Table Names
Make sure your table names match your Supabase schema:RLS Policy Dependencies
If you’re still on Lovable’s backend temporarily:Styling Issues
Tailwind Classes
Most Tailwind classes work, but check for:Font Imports
Image Handling
Standard img Tags
External Images
Build Errors
”window is not defined”
Cause: Browser API used in Server Component“document is not defined”
Same fix as above - either add ‘use client’ or ensure code runs only in browser.”Cannot find module”
Cause: Old import paths from Vite structurePost-Conversion Checklist
Common Error Messages
”Failed to fetch”
Cause: API endpoint doesn’t exist or CORS error Fix: Check that your Supabase URL is correct and accessible”Auth session missing”
Cause: Auth state not persisting or wrong Supabase project Fix: Verify you’re connecting to the right Supabase instance”Row level security violation”
Cause: RLS policies blocking your query Fix: Check RLS policies in your Supabase dashboard, or use service role for admin ops”relation does not exist”
Cause: Table name typo or schema mismatch Fix: Check exact table names in Supabase, case-sensitive!Still stuck? Check the Troubleshooting guide or use our Cloud Migration Extension to move your backend too.
