Fix production error where know-your-world game failed to load sessions due to ES module imports in CommonJS context. **Problem:** - Validator imported maps.ts at module init time - maps.ts statically imports @svg-maps/world and @svg-maps/usa (ES modules) - Server (CommonJS) cannot require() ES modules synchronously - Error: "Unexpected token 'export'" **Solution:** - Make validateMove() async (already supported by GameValidator interface) - Lazy-load getFilteredMapData() only when needed via dynamic import() - Prevents ES module loading until validator method is actually called - Client-side code continues to work normally (bundled by Next.js) - Mark know-your-world page as force-dynamic to avoid SSR issues **Changes:** - GameValidator.validateMove: Now supports Promise<ValidationResult> - KnowYourWorldValidator: Use getFilteredMapDataLazy() wrapper - session-manager: Await validator.validateMove() - know-your-world page: Add dynamic = 'force-dynamic' export Fixes the "Failed to fetch session" error for know-your-world game. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .claude | ||
| .storybook | ||
| __tests__ | ||
| content/blog | ||
| data | ||
| docs | ||
| drizzle | ||
| e2e | ||
| public | ||
| scripts | ||
| src | ||
| .dockerignore.test | ||
| .gitignore | ||
| CARD_SORTING_PORT_PLAN.md | ||
| COMPLEMENT_RACE_PORT_PLAN.md | ||
| DEVELOPMENT_STANDARDS.md | ||
| LINTING.md | ||
| README.md | ||
| biome.jsonc | ||
| drizzle.config.ts | ||
| eslint.config.js | ||
| next-env.d.ts | ||
| next.config.js | ||
| package.json | ||
| panda.config.ts | ||
| playwright.config.ts | ||
| pnpm-lock.yaml | ||
| server.js | ||
| svg-processing-test.js | ||
| test-arcade-api.sh | ||
| test-flashcards-final.pdf | ||
| test-flashcards.pdf | ||
| test-simplified.pdf | ||
| test_fullscreen_persistence.html | ||
| test_panda_simple.html | ||
| tsconfig.json | ||
| tsconfig.server.json | ||
| vitest.config.ts | ||