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-lfsorapt 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
physx-js-webidl(PhysX WASM bindings)shared(core engine)- 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
Bun 1.3.10 Upgrade
What Changed
Bun 1.3.10 introduces several changes that affect Hyperscape:-
Dependency Hoisting: Bun 1.3 no longer hoists all dependencies to the root
node_modules. Each package now has its ownnode_modulesdirectory. -
Workspace Symlinks: Workspace dependencies (e.g.,
@hyperscape/shared) are now symlinked differently, which affects Docker builds. - Vite Compatibility: Bun 1.3.10 includes fixes required for Vite 6+ to work correctly.
Migration Steps
-
Clean Install (required):
-
Update Docker Builds (if deploying):
- The Dockerfile has been updated to handle Bun 1.3’s workspace structure
- Rebuild your Docker images:
-
Verify Workspace Dependencies:
Common Issues
Issue:Cannot find module '@hyperscape/shared'
Solution: Clean install dependencies:
Vite 8.0.0 Upgrade
What Changed
Vite 8.0.0 includes several breaking changes:- Build Output: Changed default build output structure
- Plugin API: Some plugin APIs have changed
- HMR: Improved Hot Module Replacement with new protocol
Migration Steps
-
Update Dependencies:
-
Check Vite Config: Review
vite.config.tsfiles for deprecated options- Most configs should work without changes
- If you have custom plugins, check their Vite 8 compatibility
-
Test Build:
-
Test Dev Server:
Common Issues
Issue: Build fails with “Unknown option” Solution: Checkvite.config.ts for deprecated options. Common culprits:
build.polyfillDynamicImport(removed)optimizeDeps.include(syntax changed)
Docker Changes
What Changed
The Dockerfile has been significantly updated:- Bun 1.3.10: Both builder and runtime stages now use Bun 1.3.10
- Client Build: Docker image now includes client build (required for multi-service deployments)
- Workspace Symlinks: Added
bun install --productionin runtime stage to restore symlinks - Per-Package node_modules: Explicitly copy package-level node_modules directories
- better-sqlite3 Removal: Stripped from manifests to prevent QEMU segfaults
Migration Steps
-
Rebuild Docker Images:
-
Update Docker Compose (if using):
-
Verify Container Startup:
Common Issues
Issue: Container fails with “Cannot find module” Solution: Ensure you rebuilt the image after pulling latest code:bun:sqlite instead.
Dependency Updates
Major Version Bumps
The following dependencies have major version updates:Migration Steps
-
Update Dependencies:
-
Test Your Code:
- 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 --productionin 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:Runtime Errors
Symptom: Server crashes with “Cannot find module ‘@hyperscape/shared’” Solution: Workspace symlinks are broken. Reinstall:Dev Server Issues
Symptom: Dev server uses 100% CPU Solution: This was fixed in PR #1034. Ensure you’re on latest code: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. SetPUBLIC_PRIVY_APP_ID in both client and server .env files.
Getting Help
If you encounter issues not covered in this guide:- Check GitHub Issues: github.com/HyperscapeAI/hyperscape/issues
- Join Discord: discord.gg/hyperscape
- Review AGENTS.md: Detailed technical documentation
- Check CHANGELOG.md: Complete list of changes
Rollback Instructions
If you need to rollback to the previous version:Next Steps
After successfully upgrading:- Test Core Features: Verify combat, movement, inventory, etc.
- Check AI Agents: Ensure ElizaOS agents are working correctly
- Review Logs: Check for any warnings or errors
- Update Documentation: If you maintain custom docs, update them for new versions
Additional Resources
- AGENTS.md - Development guidelines
- CHANGELOG.md - Complete changelog
- README.md - Quick start guide
- Bun 1.3 Release Notes
- Vite 8 Migration Guide