mirror of
https://github.com/johndoe6345789/docker-swarm-termina.git
synced 2026-04-26 22:55:03 +00:00
The Next.js build was failing with "ReferenceError: self is not defined" during static page generation for the /dashboard page. This occurred because the @xterm/xterm library uses browser-specific APIs like 'self' which are not available during server-side rendering. Fixed by: - Converting xterm Terminal and FitAddon imports to dynamic imports - Using type-only imports for TypeScript types - Loading modules asynchronously only when the component is mounted in the browser - Keeping CSS import at top level (safe for SSR as it's handled by bundler) This ensures xterm code only executes in the browser environment while maintaining full functionality of the interactive terminal feature. https://claude.ai/code/session_01FwrvrFYEkL58b9HxjGDNUM