Symptoms:
- CSS styles not loading after changes
- Page showing unstyled content
- Need to restart dev server frequently
Solutions:
-
Try Turbo mode (recommended):
npm run dev # This now uses --turbo flag for better hot reload -
Fallback to legacy mode:
npm run dev:legacy # Uses standard Next.js dev server -
Clean cache and restart:
npm run dev:clean # Cleans .next and cache, then starts dev server -
Manual cleanup:
rm -rf .next rm -rf node_modules/.cache npm run dev
Symptoms:
GET /_next/static/css/app/layout.css 404GET /_next/static/chunks/main-app.js 404
Solutions:
-
Restart dev server completely:
# Kill all node processes pkill -f node npm run dev -
Clear Next.js cache:
npx next clean npm run dev
-
Check for port conflicts:
# Kill process on port 3000 lsof -ti:3000 | xargs kill -9 npm run dev
Check the debug console in the app:
- Click "Test Availability" button
- Check browser console for detailed logs
Setup Requirements:
-
Chrome Canary (not regular Chrome)
-
Enable flags:
chrome://flags/#prompt-api-for-gemini-nano→ Enabledchrome://flags/#optimization-guide-on-device-model→ Enabled BypassPerfRequirement
-
Download model:
- Go to
chrome://components/ - Find "Optimization Guide On Device Model"
- Click "Check for update"
- Go to
-
Restart Chrome Canary completely
Debug steps:
- Open browser dev tools (F12)
- Check console logs for:
- "Raw AI Response:"
- "Extracted AI Response Text:"
- "Parsed invoice data:"
- Use the debug console in the app to test extraction
Fixed in latest version - now uses SVG favicon instead of PNG icons.
If you still see errors:
# Check if favicon.svg exists
ls -la public/favicon.svgCheck:
- Browser developer tools → Application → Local Storage
- Look for
shawai-databasekey - If missing or corrupted, clear storage:
// Run in browser console
localStorage.clear();
location.reload();Debug SQL issues:
- Open browser console
- Look for database-related errors
- Check if
sql-wasm.wasmfile exists inpublic/folder
ls -la public/sql-wasm.wasmIf missing:
cp node_modules/sql.js/dist/sql-wasm.wasm public/Solutions:
-
Use Turbo mode:
npm run dev # Now uses --turbo by default -
Disable TypeScript checking during dev:
# In next.config.js, add: typescript: { ignoreBuildErrors: true, } -
Reduce file watching:
# Add to next.config.js webpack config: watchOptions: { poll: 1000, aggregateTimeout: 300, }
Fixed - This was caused by null/undefined totals in invoice data.
Fixed - State updates moved to proper useEffect hooks.
npm install sql.js
cp node_modules/sql.js/dist/sql-wasm.wasm public/Check Chrome Canary setup and flags configuration.
# Check if you're using Canary
navigator.userAgent
# Should contain "Chrome" and a recent version numberKeep dev tools open to catch errors early:
- Console tab for JavaScript errors
- Network tab for 404/failed requests
- Application tab for storage issues
Use the debug console in the app to verify LanguageModel is working.
# Nuclear option - clears everything
rm -rf .next
rm -rf node_modules/.cache
npm install
npm run dev-
Complete restart:
# Kill all node processes pkill -f node # Clear all caches rm -rf .next rm -rf node_modules/.cache # Restart npm run dev
-
Check versions:
node --version # Should be 18+ npm --version # Should be 9+
-
Reinstall dependencies:
rm -rf node_modules rm package-lock.json npm install npm run dev
-
Check port availability:
# Try different port npm run dev -- -p 3001
Monitor these during development:
- Memory usage in dev tools
- Hot reload speed
- LanguageModel response times
- Database operation performance
The debug console will show timing information for AI operations.
Need more help? Check the console output carefully - most issues show detailed error messages that point to the root cause.