**Problem:** - player-ownership.ts imported drizzle-orm and @/db at top level - When RoomMemoryPairsProvider imported client-safe utilities, Webpack bundled ALL imports including database code - This caused hydration error: "The 'original' argument must be of type Function" - Node.js util.promisify was being called in browser context **Solution:** 1. Created player-ownership.client.ts with ONLY client-safe utilities - No database imports - Safe to import from 'use client' components - Contains: buildPlayerOwnershipFromRoomData(), buildPlayerMetadata(), helper functions 2. Updated player-ownership.ts to re-export client utilities and add server-only functions - Re-exports everything from .client.ts - Adds buildPlayerOwnershipMap() (async, database-backed) - Safe to import from server components/API routes 3. Updated RoomMemoryPairsProvider to import from .client.ts **Result:** - No more hydration errors on /arcade/room - Client bundle doesn't include database code - Server code can still use both client and server utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
35 lines
847 B
HTML
35 lines
847 B
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Test Panda CSS</title>
|
|
<style>
|
|
/* Inline test to see if the page styling issue is basic layout */
|
|
.test-center {
|
|
text-align: center;
|
|
padding: 20px;
|
|
max-width: 800px;
|
|
margin: 0 auto;
|
|
background: #f5f5f5;
|
|
border: 2px solid #333;
|
|
}
|
|
.test-btn {
|
|
background: #007bff;
|
|
color: white;
|
|
border: none;
|
|
padding: 12px 24px;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
margin: 10px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="test-center">
|
|
<h2>Basic Layout Test</h2>
|
|
<p>This should be centered with a grey background and border</p>
|
|
<button class="test-btn">Test Button 1</button>
|
|
<button class="test-btn">Test Button 2</button>
|
|
</div>
|
|
</body>
|
|
</html>
|