Changes Not Reflected
Situation
isActive is not a function error on API call.
Cause 1: Using Static Import
Thereβs likely a static import of UserModel somewhere. How to check:Sonamuβs Syncer automatically handles dynamic imports for Entity-based files, so this problem
doesnβt occur in typical Model/API files. It mainly occurs in custom scripts or initialization
code.
Cause 2: Error Hidden in Console
An error may have occurred during HMR but you missed it. How to check: Scroll through the terminal to check for errors like:Cause 3: Cache Corruption
Rarely, ESM cache may not be completely removed. Solution: Server restartβFile not imported dynamicallyβ Error
Situation
Cause
A Boundary file (user.model.ts) was loaded via static import somewhere.Quick Fix
Option 1: Change static import to dynamic import (Recommended) Find the file mentioned in the error message:Memory Increase on Reload
Situation
Cause
Resources from previous modules (timers, event listeners, connections, etc.) arenβt cleaned up, causing leaks. How to check:Solution
Clean up resources withimport.meta.hot.dispose():
Example 1: Timers
API Registered Multiple Times
Situation
Cause
Existing APIs werenβt removed when Model file was reloaded.Check
Check if API removal is shown in Syncer logs:Solution
Syncer normally handles this automatically, but if problem persists: 1. Server restartCircular Dependency Issues
Situation
Cause
Circular reference between Models:Solutions
Option 1: Import only types (Recommended)HMR Not Working for Specific Files
Situation
Cause 1: Not Matching Boundary Pattern
Check:Cause 2: File Not Imported
HMR only tracks files that are actually imported. Check:SSR File Changes Not Reloading
Situation
Cause
SSR files are handled specially.Fix
Syncer automatically handles SSR file changes, but if manual reload is needed:HMR Too Slow
Situation
Cause
Dependency tree is too deep or wide, invalidating many files. Check:Solutions
1. Minimize importsDebugging Tips
Enable HMR Logs
To see detailed HMR operation:Check Dependency Tree
Track Invalidated Files
Pay close attention to logs Syncer prints to console:Monitor Memory Usage
Last Resort: Full Restart
When all solutions fail:Getting Help
If the problem still isnβt resolved:1. Report to GitHub Issues
Create a new issue at: https://github.com/cartanova-ai/sonamu/issues2. Include the Following Information
Please provide this information for problem resolution:- Sonamu version (
package.json) - Node.js version (
node -v) - Error message that occurred
- Minimal reproducible example
- HMR logs (
DEBUG=hmr-hook:* pnpm dev)