mirror of
https://github.com/johndoe6345789/docker-swarm-termina.git
synced 2026-04-26 14:45:02 +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
This is a Next.js project bootstrapped with create-next-app.
Getting Started
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.