Debug & cache — troubleshooting SPA
Gejala umum saat mengembangkan SPA NXDOM dan langkah perbaikannya.
1. Tabel gejala
| Gejala | Langkah |
|---|---|
| Splash / halaman tidak berubah | Network: App.js, nxdom.js, /templates/beranda.js → status 200 |
| Handler kosong | Konsol: window.nexaRoute?.routes harus punya kunci rute |
| Error di halaman | ?nexaDebug=1 atau debugRouteErrors: true di App.js |
| JavaScript lama | Ctrl+F5; DevTools → Disable cache |
| Preview OG (WhatsApp/FB) lama | Facebook Sharing Debugger / LinkedIn Post Inspector — scrape ulang |
| Last route mengganggu | Clear site data; hapus IndexedDB NexaStoreDB |
App.js 403 |
Keamanan .htaccess |
| Worker / cache API | ?nexaWorkerDebug=1; lihat Web Worker |
2. Perintah konsol (uji)
window.nexaRoute?.routes?.keys?.();
window.nexaPage?.registeredRoutes;
NEXA.url;
NEXA.apiBase;
await NX.load("beranda");Objek global: Objek global (window).