Skip to main content

Migration Guide

This guide helps you upgrade Hyperscape to the latest version with minimal disruption.

Table of Contents

Upgrading to March 2026 Release

Prerequisites

Before upgrading, ensure you have:
  • Git LFS installed (brew install git-lfs or apt install git-lfs)
  • Docker Desktop running (for local development)
  • Backup of your local database (if you have important data)

Step 1: Update Bun

The March 2026 release requires Bun 1.3.10 or higher (upgraded from 1.1.38). Why? Bun 1.3.10 is required for Vite 6+ compatibility and includes important fixes for workspace dependency resolution.

Step 2: Pull Latest Code

Step 3: Clean Install Dependencies

Important: You must do a clean install due to Bun’s changed dependency hoisting behavior in 1.3.x.

Step 4: Rebuild All Packages

This will build:
  1. physx-js-webidl (PhysX WASM bindings)
  2. shared (core engine)
  3. All other packages (server, client, etc.)

Step 5: Reset Database (Optional)

If you encounter database schema errors, reset your local database:
⚠️ Warning: This will delete all local data (characters, inventory, progress).

Step 6: Start Development Server

Open http://localhost:3333 in your browser.

Bun 1.3.10 Upgrade

What Changed

Bun 1.3.10 introduces several changes that affect Hyperscape:
  1. Dependency Hoisting: Bun 1.3 no longer hoists all dependencies to the root node_modules. Each package now has its own node_modules directory.
  2. Workspace Symlinks: Workspace dependencies (e.g., @hyperscape/shared) are now symlinked differently, which affects Docker builds.
  3. Vite Compatibility: Bun 1.3.10 includes fixes required for Vite 6+ to work correctly.

Migration Steps

  1. Clean Install (required):
  2. Update Docker Builds (if deploying):
    • The Dockerfile has been updated to handle Bun 1.3’s workspace structure
    • Rebuild your Docker images:
  3. Verify Workspace Dependencies:

Common Issues

Issue: Cannot find module '@hyperscape/shared' Solution: Clean install dependencies:
Issue: Build fails with “Cannot resolve module” Solution: Ensure you’re using Bun 1.3.10+:

Vite 8.0.0 Upgrade

What Changed

Vite 8.0.0 includes several breaking changes:
  1. Build Output: Changed default build output structure
  2. Plugin API: Some plugin APIs have changed
  3. HMR: Improved Hot Module Replacement with new protocol

Migration Steps

  1. Update Dependencies:
  2. Check Vite Config: Review vite.config.ts files for deprecated options
    • Most configs should work without changes
    • If you have custom plugins, check their Vite 8 compatibility
  3. Test Build:
  4. Test Dev Server:

Common Issues

Issue: Build fails with “Unknown option” Solution: Check vite.config.ts for deprecated options. Common culprits:
  • build.polyfillDynamicImport (removed)
  • optimizeDeps.include (syntax changed)
Issue: HMR not working in dev mode Solution: Clear Vite cache and restart:

Docker Changes

What Changed

The Dockerfile has been significantly updated:
  1. Bun 1.3.10: Both builder and runtime stages now use Bun 1.3.10
  2. Client Build: Docker image now includes client build (required for multi-service deployments)
  3. Workspace Symlinks: Added bun install --production in runtime stage to restore symlinks
  4. Per-Package node_modules: Explicitly copy package-level node_modules directories
  5. better-sqlite3 Removal: Stripped from manifests to prevent QEMU segfaults

Migration Steps

  1. Rebuild Docker Images:
  2. Update Docker Compose (if using):
  3. Verify Container Startup:

Common Issues

Issue: Container fails with “Cannot find module” Solution: Ensure you rebuilt the image after pulling latest code:
Issue: better-sqlite3 errors in Docker Solution: This is expected - better-sqlite3 has been removed from Docker builds. Use PostgreSQL or bun:sqlite instead.

Dependency Updates

Major Version Bumps

The following dependencies have major version updates:

Migration Steps

  1. Update Dependencies:
  2. Test Your Code:
  3. Check for Deprecation Warnings: Review console output for any deprecation warnings

Common Issues

Issue: Tests fail with jsdom errors Solution: jsdom 29.0.0 has stricter DOM compliance. Update your tests to use proper DOM APIs. Issue: Hardhat tests fail Solution: @nomicfoundation/hardhat-ethers 4.x requires Ethers.js v6. Update your contract tests:

Breaking Changes

Bun 1.3.10

  • Workspace Dependencies: No longer hoisted to root node_modules
    • Impact: Docker builds must explicitly copy per-package node_modules
    • Migration: Use updated Dockerfile or run bun install --production in runtime stage

Vite 8.0.0

  • Plugin API: Some plugin hooks have changed
    • Impact: Custom Vite plugins may need updates
    • Migration: Check Vite 8 plugin migration guide
  • Build Output: Default output structure changed
    • Impact: Minimal - Hyperscape uses custom output config
    • Migration: No action needed if using default config

jsdom 29.0.0

  • DOM API: Stricter standards compliance
    • Impact: Some tests may fail if using non-standard DOM APIs
    • Migration: Update tests to use proper DOM APIs

Troubleshooting

Build Errors

Symptom: Build fails with “Cannot resolve module” Solution:
Symptom: Build fails with “Unknown option in vite.config.ts” Solution: Check for deprecated Vite options and remove them.

Runtime Errors

Symptom: Server crashes with “Cannot find module ‘@hyperscape/shared’” Solution: Workspace symlinks are broken. Reinstall:
Symptom: Docker container fails to start Solution: Rebuild image with no cache:

Dev Server Issues

Symptom: Dev server uses 100% CPU Solution: This was fixed in PR #1034. Ensure you’re on latest code:
Symptom: File watcher not detecting changes Solution: The watcher may have fallen back to polling mode. Check console for warnings. This is expected behavior on some systems.

Database Issues

Symptom: Database schema errors after upgrade Solution: Reset database (see Step 5 above). Symptom: Characters vanishing after upgrade Solution: This is likely due to Privy credentials missing. Set PUBLIC_PRIVY_APP_ID in both client and server .env files.

Getting Help

If you encounter issues not covered in this guide:
  1. Check GitHub Issues: github.com/HyperscapeAI/hyperscape/issues
  2. Join Discord: discord.gg/hyperscape
  3. Review AGENTS.md: Detailed technical documentation
  4. Check CHANGELOG.md: Complete list of changes

Rollback Instructions

If you need to rollback to the previous version:

Next Steps

After successfully upgrading:
  1. Test Core Features: Verify combat, movement, inventory, etc.
  2. Check AI Agents: Ensure ElizaOS agents are working correctly
  3. Review Logs: Check for any warnings or errors
  4. Update Documentation: If you maintain custom docs, update them for new versions

Additional Resources