Troubleshooting
Here are some common issues you might encounter and how to fix them.
Mobile Issues
CocoaPods Issues
If you see errors related to CocoaPods, try cleaning the build folder and reinstalling pods.
cd ios
pod deintegrate
pod installMetro Bundler Issues
If the bundler gets stuck, try clearing the cache.
npx expo start -cWeb Platform Issues
Hydration Mismatch Errors
If you see "Hydration failed because the initial UI does not match" errors:
- Theme-related: Ensure
suppressHydrationWarningis on the<html>tag inlayout.tsx - Auth state: The
AuthHydratorcomponent handles this - don't access auth state in server components - Date/time rendering: Use
useEffectfor time-sensitive content
// Bad - causes hydration mismatch
const date = new Date().toLocaleDateString();
// Good - renders client-side only
const [date, setDate] = useState<string>();
useEffect(() => {
setDate(new Date().toLocaleDateString());
}, []);OAuth Callback Fails
Common OAuth Issues
OAuth problems are usually caused by redirect URI mismatches or CORS configuration.
- Check redirect URI: Must exactly match what's configured in OAuth provider
- Check CORS: Backend must allow your web origin
- Check cookies: Ensure you're not blocking third-party cookies in development
- Apple Sign In: Remember that Apple requires HTTPS - won't work on localhost
Debug with:
# Check backend logs
docker logs backend-container
# Verify CORS headers
curl -I http://localhost:8080/api/auth/sessionApple Sign In Not Working in Development
Apple Sign In requires HTTPS redirect URIs and will not work with http://localhost. Options:
- Use ngrok or Cloudflare Tunnel: Create an HTTPS tunnel to your backend
ngrok http 8080
# Use the https://xxx.ngrok.io/api/auth/callback/apple URL as your redirect URI- Skip Apple in dev: Test Apple Sign In only in staging/production environments
- Use mobile: Apple Sign In works in development on the mobile app via native SDKs
Session Not Persisting
- Cookie settings: In development, cookies require
SameSite=LaxandSecure=false - Domain mismatch: Ensure frontend and backend are on the same domain (or properly configured for cross-domain)
- Check browser DevTools: Network tab -> Cookies to see if session cookie is being set
404 on Refresh (Deployed)
If routes work initially but 404 on refresh:
- Vercel: Should work out of the box
- Netlify: Install the
@netlify/plugin-nextjsplugin
netlify.toml
[[plugins]]
package = "@netlify/plugin-nextjs"Avoid SPA Redirects
Do NOT use SPA-style redirects on Netlify - Next.js uses SSR, not static file serving.
- Self-hosted Node.js: Ensure you're running
next start(not serving static files) - Docker/Nginx: Use a reverse proxy to the Node.js server, not static file serving
Build Fails with Module Errors
# Clear Next.js cache
rm -rf web/.next
# Reinstall dependencies
rm -rf web/node_modules
bun installStill stuck?
Join our Discord server for help from the community.