# Troubleshooting & errors

> Find fast, symptom-first fixes for build crashes, sign-in errors, DNS delays, Stripe checkout mismatches, Android installs, and slow pages.

- Canonical: https://exaspark.ai/docs/troubleshooting/

## How to triage any issue quickly

Every error originates in one of four boundaries: your **Preview** build, your **Live** runtime, an external provider (DNS registrar, Stripe, or Google Play Console), or a visitor's browser. Identifying which layer failed first saves credits and avoids blind rewrites.

If **Live** is already affected for real visitors, roll back to the previous stable release immediately from Publish history, then reproduce and fix the issue safely in **Preview**.

## Build and Preview crashes

Build failures usually follow a multi-file edit, a renamed database column, or an incompatible package update.

| Symptom | Likely cause | Exact fix |
| --- | --- | --- |
| **Red error banner or blank Preview** | Compile error, missing import, or runtime crash in a recent edit | Click **Ask AI to fix** on the banner so the Agent reads the exact log |
| **Ask AI to fix repeats the same error twice** | Conflicting changes accumulated across recent turns | Click **Undo** back to the last green checkpoint and split the request smaller |
| **Preview fails after a schema rename** | UI form or API route still references the old field name | Ask the Agent to align queries, forms, and **Cloud** fields to the new schema |
| **Preview works but Publish build fails** | Production type check or server bundle error caught at deploy | Click **Ask AI to fix** in Publish settings; re-publish once green |

### When to use Ask AI to fix vs Undo

- **Use Ask AI to fix** when the banner shows a concrete syntax, import, type, or deploy log error after a desirable edit.
- **Use Undo** immediately if two fix attempts stall or an experimental redesign broke working screens. See [Working with the Agent](https://exaspark.ai/docs/working-with-the-agent/).

## Sign-in and role-permission errors

Authentication failures almost always trace to Preview vs Live isolation, OAuth callbacks, or frontend-only role checks.

| Symptom | Likely cause | Exact fix |
| --- | --- | --- |
| **OAuth redirect error after custom domain** | Provider callback still points only to `.exaspark.app` | Re-verify your custom domain and confirm OAuth callback URLs match Live |
| **Preview account cannot sign into Live** | **Preview** and **Live** maintain separate user directories | Register a fresh user on **Live**; Preview accounts never copy automatically |
| **Admin sees "Access denied"** | Account lacks the `admin` role in the active environment | Open **Cloud** for that environment and set your user's role to `admin` |
| **Member views admin pages or others' data** | Check exists only in UI instead of server routes | Ask the Agent to enforce server-side role and owner checks on every endpoint |
| **Verification email never arrives** | Missing custom sender DNS records or Free `100`/mo cap hit | Check spam, verify DNS in [Branded email](https://exaspark.ai/docs/branded-email/), and check plan quota |

## Custom domain DNS and SSL issues

Domain verification and automatic TLS issuance require clean, non-conflicting DNS records at your registrar.

| Symptom | Likely cause | Exact fix |
| --- | --- | --- |
| **Verification stuck over 30 minutes** | Registrar proxy (such as Cloudflare orange cloud) or record typo | Switch the record to DNS-only, confirm exact **A** or **CNAME** values, and click **Verify** |
| **www works, root domain fails** | Missing apex (`@`) record or leftover parked-page record | Delete stale `A` or `AAAA` records on `@`, keep only ExaSpark records, and re-verify |
| **Browser warns "Not private"** | Automatic SSL certificate is still issuing | Wait 5–15 minutes after DNS verifies, then reload in a private window |
| **Old website still loads** | High registrar TTL (for example 24 hours) or cached local DNS | Wait for TTL expiry and verify live global records via terminal lookup |

Run a fast lookup to confirm what public resolvers return and spot leftover `AAAA` or conflicting `A` records:

```text
DNS Quick Check Commands
- Apex A record:       dig +short A yourdomain.com
- www CNAME record:    dig +short CNAME www.yourdomain.com
- Conflicting IPv6:    dig +short AAAA yourdomain.com
- Windows lookup:      nslookup -type=A yourdomain.com
```

Remove any stale IP address that does not match your Publish settings. See [Custom domains & DNS](https://exaspark.ai/docs/custom-domains-and-dns/).

## Stripe checkout and subscription issues

Payment mismatches usually occur during the switch from **Test mode** to **Live mode** or when webhook handlers miss lifecycle events.

| Symptom | Likely cause | Exact fix |
| --- | --- | --- |
| **Card charged, app stays locked** | Webhook handler failed or missed user metadata | Check Stripe webhook delivery logs and API errors in Analytics, then patch in Preview |
| **Real card rejected with test-mode error** | Live app still runs Stripe **Test mode** | Toggle payments to **Live mode** and click **Publish** |
| **Canceled plan stays active in app** | App listens for checkout completion but not cancellation events | Ask the Agent to handle `customer.subscription.deleted` and `updated` webhooks |
| **Checkout shows wrong price or currency** | Old Stripe Price ID still referenced in checkout action | Update Stripe pricing and bind the exact live Price ID in chat |

Verify one real low-value transaction after switching to Live mode, confirm the database row and receipt email, and then refund it. See [Testing Stripe & webhooks](https://exaspark.ai/docs/testing-stripe-and-webhooks/).

## Android QR install and Play Console warnings

Mobile packaging involves Android device permissions and Google Play Console metadata validation.

| Symptom | Likely cause | Exact fix |
| --- | --- | --- |
| **Android blocks browser APK install** | Browser lacks permission to install packages | Tap **Settings**, enable **Install unknown apps** for Chrome, and retry |
| **QR install opens an older version** | QR points to an earlier package before your latest edits | Rebuild the Android package after publishing and scan the new QR code |
| **Play Console rejects `.aab` version code** | Upload reuses a previously submitted `versionCode` | Bump the Android build version, export a new signed `.aab` on Starter or Pro, and re-upload |
| **Play Console flags privacy or Data Safety** | Missing live Privacy Policy URL or mismatched Data Safety answers | Publish a live Privacy Policy page and align Data Safety with sign-in and Stripe flows |
| **iPhone user cannot open Android QR** | APK builds install on Android devices only | Tell iPhone users to open your live link in Safari, tap **Share**, then **Add to Home Screen** |

See [Android QR install](https://exaspark.ai/docs/android/) and [Publish to Google Play](https://exaspark.ai/docs/google-play/) for full mobile steps.

## Slow pages and missing uploaded images

Media sizing, file-storage access rules, and unpaginated queries explain most live asset and latency problems.

| Symptom | Likely cause | Exact fix |
| --- | --- | --- |
| **Slow mobile homepage or catalog** | Oversized raw photo uploads or unpaginated initial list | Compress hero imagery, generate right-sized assets in [Creative Studio](https://exaspark.ai/docs/media/), and lazy-load lower rows |
| **Uploaded image returns broken icon or 403** | Private file-storage rule blocks public visitor reads | Mark public catalog images public-read while keeping private uploads role-scoped |
| **Admin dashboard lags as rows grow** | Query loads entire table without pagination or indexes | Add server-side pagination (20 rows/page) and indexes on filtered columns |
| **Old logo still displays after update** | Browser cached the prior asset under the same filename | Upload under a fresh asset reference and hard-refresh after publishing |

## Writing a high-signal bug report prompt

Vague messages like "checkout is broken" burn turns guessing. Paste four concrete lines so the Agent isolates the root cause immediately:

```text
Bug Report Template
- Route & environment: /pricing -> /checkout on Live (reproduced in Preview)
- User state: Signed in as standard Member (non-admin)
- Steps: Click "Join Monthly", complete Stripe Test card 4242, open /account
- Observed vs expected: /account stays "Free tier" instead of "Active Member"
```

> **Example prompt (App):** On /account after completing Stripe Test checkout for the $9/month membership, payment succeeds and redirects back, but membership_status in Cloud stays "free". Inspect the Stripe webhook handler, verify user_id metadata on the checkout session, and update membership_status on checkout.session.completed.

## Next steps

- [Analytics & live health](https://exaspark.ai/docs/analytics/) — Spot API 5xx errors, slow queries, and uptime drops fast.
- [Optimizing credit usage](https://exaspark.ai/docs/optimizing-credits/) — Stop multi-turn patch loops and keep debugging lean.
- [Production launch checklist](https://exaspark.ai/docs/production-checklist/) — Catch auth, DNS, and Stripe bugs before launch day.

## From the blog

- [Common vibe coding mistakes](https://exaspark.ai/blog/vibe-coding-mistakes/) — Avoid habits that introduce fragile AI-built bugs.
- [Why AI-built apps stall after launch](https://exaspark.ai/blog/why-ai-built-apps-stall-after-launch/) — Fix operational bottlenecks right after shipping.
- [App security checklist](https://exaspark.ai/blog/app-security-checklist/) — Prevent permission leaks and config errors early.
