Common Issues
Folds not syncing between devices
Folds not syncing between devices
Symptoms:Verify Sync Settings:Check File Sync Configuration:Ensure your file sync solution (Obsidian Sync, iCloud, Syncthing, Git, etc.) is configured to sync:For Obsidian Sync:
- Fold states appear on Device A but not Device B
- Folds reset to unfolded state after switching devices
- Inconsistent fold behavior across vault instances
- Sync disabled in plugin settings
- File sync solution not syncing
data.json - Plugin not enabled on all devices
- Cached fold states out of sync
- Settings → Sync → Settings sync → Enable “Community plugins”
- Verify the
.obsidian/plugins/folder is not excluded - Check that hidden files are being synced
- Add to
.gitignoreif present:
- On Device A (source of truth):
- Run “Export folds from local storage” command
- Wait for file sync to upload
data.json
- On Device B:
- Close all notes
- Run “Import folds into local storage” command
- Reopen notes to see folds applied
Plugin not loading or commands missing
Plugin not loading or commands missing
Symptoms:Check Obsidian Version:The plugin requires Obsidian v0.15.0 or later.
- Plugin appears in Community plugins list but doesn’t load
- “Sync Folds” commands don’t appear in command palette
- Console shows plugin errors
- Corrupted installation
- Missing or invalid
manifest.json - Incompatible Obsidian version
- JavaScript errors during initialization
- Go to Settings → About
- Check “Current version”
- Update Obsidian if necessary
- Settings → Community plugins
- Click the “X” next to “Sync Folds” to uninstall
- Browse community plugins
- Search for “Sync Folds” and reinstall
- Enable the plugin
- Open developer console (Ctrl/Cmd + Shift + I)
- Look for errors related to “sync-folds” or “[SyncFolds]”
- Common errors:
Failed to load plugin sync-folds: Missing or corruptedmain.jsTypeError: Cannot read property 'appId' of undefined: Obsidian API incompatibility
- Download the latest release from GitHub
- Extract
main.jsandmanifest.json - Copy to
.obsidian/plugins/sync-folds/ - Restart Obsidian
- Enable plugin in Settings
localStorage conflicts or corruption
localStorage conflicts or corruption
Symptoms:Note:
- Folds appear in random files
- Folds don’t match document structure
- Console shows JSON parsing errors
- Plugin stops responding after a while
- Multiple Obsidian instances writing to same vault
- Browser extensions interfering with localStorage
- Corrupted fold data in
data.json - Manual edits to
data.jsonwith invalid JSON
- Open developer console (Ctrl/Cmd + Shift + I)
- Go to “Application” or “Storage” tab
- Expand “Local Storage”
- Find entries matching
{appId}-note-fold-* - Delete all fold-related entries
- Run “Export folds from local storage” to regenerate
- Disable “Sync Folds” plugin
- Close Obsidian
- Delete
.obsidian/plugins/sync-folds/data.json - Reopen Obsidian
- Enable “Sync Folds” plugin
- Plugin will create fresh
data.jsonfrom current localStorage
data.json file should look like:folds is a JSON string containing escaped quotes.Check for Multiple Obsidian Instances:Running multiple Obsidian windows/instances for the same vault can cause conflicts:- Close all Obsidian windows
- Reopen only one instance
- Verify folds are working
- If using multiple devices, ensure they’re not open simultaneously
Sync conflicts with file sync solutions
Sync conflicts with file sync solutions
Symptoms:
data.jsonkeeps getting overwritten- Fold states alternate between two different sets
- “Conflicted copy” files appear in sync folder
- Folds disappear randomly
- Both devices writing to
data.jsonsimultaneously - File sync service creating conflict copies
- Network latency causing delayed syncs
- Plugin’s debouncing not sufficient for sync solution
- Settings → Sync → Vault size over limit
- Check if you’re near the limit (may cause partial syncs)
- Settings → Sync → Sync activity
- Look for “Failed to upload” or “Conflict” messages
- Temporarily disable sync, export folds, re-enable sync
- Search for files named like:
- Manually merge the data:
- Open both files
- Copy fold entries from conflicted copy
- Paste into main
data.json(ensure valid JSON) - Delete conflicted copy
- Run “Import folds into local storage”
data.json:- If merge conflict occurs:
- Decide which version to keep (usually the most recent)
- Resolve manually or choose one side:
- Or use a merge tool to combine both versions
.sync-conflict files:- Look for:
- Compare with main
data.json - Merge fold data manually
- Delete conflict file
- Close Obsidian on Device A before opening on Device B
- Run “Export folds” before closing Obsidian
- Wait for file sync to complete before switching devices
- Use a sync solution with built-in conflict resolution (Obsidian Sync recommended)
Performance issues or lag when folding
Performance issues or lag when folding
Symptoms:If Check Disk Performance:If your vault is on a network drive or slow external disk:
- Noticeable delay when folding/unfolding sections
- Obsidian freezes briefly during fold operations
- High CPU usage when working with large documents
- Slow file switching
- Very large vault with thousands of files
- Large
data.jsonfile (> 1MB) - Slow disk I/O
- Debouncing delay too short, causing excessive writes
data.json is > 1MB:- Many folds are being tracked
- Consider pruning old/unused fold states:
- Open developer console
- Run:
- Manually edit
data.jsonto remove folds for deleted files
- Consider disabling sync temporarily when doing bulk operations
- Fold only actively used documents
- Unfold all before archiving notes
- Move vault to local SSD for better performance
- Ensure file sync service isn’t saturating disk I/O
- Check for antivirus software scanning every file write
Debugging Steps
Step 1: Verify Plugin is Enabled
- Open Settings → Community plugins
- Find “Sync Folds” in the installed plugins list
- Ensure the toggle is ON (blue/green, not grayed out)
- If OFF, toggle it ON and check if commands appear
Step 2: Check data.json Exists
Navigate to your vault’s plugin folder:- Enable the plugin (it will create the file)
- Run “Export folds from local storage” command
Step 3: Inspect localStorage
Open the developer console (Ctrl/Cmd + Shift + I) and run:- Fold some headings in a note
- Run the script again to verify keys are being created
Step 4: Check Sync is Working
-
Create a test fold:
- Open any note
- Fold a heading (click the arrow or use Ctrl/Cmd + Shift + [)
- Wait 1 second (debounce delay)
-
Verify it was saved:
-
Check the file path appears:
- Look for your test note’s path in the output
- If missing, the plugin’s localStorage interception may not be working
Step 5: Enable Debug Logging
To see detailed plugin activity:Debug logging requires rebuilding the plugin from source code. This is an advanced troubleshooting step.
- Clone the plugin repository
- Edit
esbuild.config.mjsand change: - Build:
npm run build - Copy
main.jsto your vault’s plugin folder - Restart Obsidian
- Open developer console and filter by
[SyncFolds]
log() function is defined in log.ts:3-7 and only outputs when DEBUG is true.
Error Messages
”Failed to parse folds string”
Full Error:folds field in data.json contains invalid JSON.
Solution:
- Open
.obsidian/plugins/sync-folds/data.json - Check if the
foldsvalue is properly formatted: - If corrupted, replace with
"folds": "{}" - Restart Obsidian
- Run “Export folds from local storage” to regenerate
main.ts:62-65
”Failed to parse fold JSON”
Full Error:- Identify the problematic file from console logs
- Open developer console
- Remove the corrupted entry:
- Refold the document manually
main.ts:260
”Fold state removed”
Log Message:main.ts:155-156
Advanced Troubleshooting
Manually Inspecting Plugin State
Open the developer console and run:Comparing localStorage and data.json
To check if they’re in sync:- Run “Export folds from local storage” to update data.json with localStorage
- Or run “Import folds into local storage” to update localStorage with data.json
Testing localStorage Interception
Verify the plugin is intercepting localStorage:Getting Help
If you’ve tried all troubleshooting steps and still have issues:-
Check GitHub Issues:
- Visit: https://github.com/itsonlyjames/obsidian-sync-folds/issues
- Search for similar problems
-
Create a Bug Report:
- Include:
- Obsidian version (Settings → About)
- Plugin version (Settings → Community plugins)
- Operating system
- File sync solution (Obsidian Sync, iCloud, etc.)
- Error messages from console
- Steps to reproduce
- Include:
-
Gather Debug Information: