Frontend fixes for Safari/iPad WebSocket reliability: 1. Add Vite allowedHosts config (nuxt.config.ts) - Allow gameplay-demo.manticorum.com for external access - Fixes "Blocked request" error after Vite security update 2. Add connection timeout failsafe (useWebSocket.ts) - 10-second timeout resets stuck "isConnecting" state - Prevents Heisenbug where Safari connections hang indefinitely - Auto-schedules reconnection after timeout 3. Add visible debug info to connection modal (games/[id].vue) - Shows WS URL, socket status, and connection log - Helps diagnose Safari-specific issues without dev tools 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
export default defineNuxtConfig({
|
|
srcDir: '.',
|
|
|
|
modules: ['@nuxtjs/tailwindcss', '@pinia/nuxt', '@nuxt/eslint'],
|
|
|
|
pages: true,
|
|
|
|
dir: {
|
|
pages: 'pages'
|
|
},
|
|
|
|
runtimeConfig: {
|
|
public: {
|
|
leagueId: 'sba',
|
|
leagueName: 'Stratomatic Baseball Association',
|
|
apiUrl: process.env.NUXT_PUBLIC_API_URL || 'http://localhost:8000',
|
|
wsUrl: process.env.NUXT_PUBLIC_WS_URL || 'http://localhost:8000',
|
|
discordClientId: process.env.NUXT_PUBLIC_DISCORD_CLIENT_ID || '',
|
|
discordRedirectUri: process.env.NUXT_PUBLIC_DISCORD_REDIRECT_URI || 'http://localhost:3000/auth/callback',
|
|
}
|
|
},
|
|
|
|
compatibilityDate: '2025-07-15',
|
|
|
|
devtools: { enabled: true },
|
|
|
|
// Allow access from Nginx Proxy Manager
|
|
devServer: {
|
|
host: '0.0.0.0', // Listen on all network interfaces
|
|
port: 3000
|
|
},
|
|
|
|
// Vite config for external hostname access
|
|
vite: {
|
|
server: {
|
|
allowedHosts: ['gameplay-demo.manticorum.com', 'localhost', '127.0.0.1']
|
|
}
|
|
},
|
|
|
|
typescript: {
|
|
strict: true,
|
|
typeCheck: false // Disable in dev - use `npm run type-check` manually
|
|
}
|
|
})
|