Troubleshooting
Common issues and solutions for the Seeder Tool
Troubleshooting
Solutions to common problems you might encounter while using the Seeder Tool.
Environment Issues
"NEXT_PUBLIC_INSTANT_APP_ID is not defined"
Problem: Environment variable is missing.
Solution:
# Check if .env file exists
ls -la .env
# Add to .env file
echo "NEXT_PUBLIC_INSTANT_APP_ID=your-app-id-here" >> .env
# Verify it's set
cat .env | grep NEXT_PUBLIC_INSTANT_APP_IDFinding Your App ID:
- Go to InstantDB Dashboard
- Select your app
- Copy the App ID from settings
Environment Variable Not Loading
Problem: .env file exists but variable isn't loaded.
Solution:
# Ensure .env is in project root
pwd # Should show project root
# Check file location
ls -la .env
# Verify dotenv is installed
bun list | grep dotenvFile Reading Issues
"Failed to read file"
Problem: File path is incorrect or file doesn't exist.
Solution:
# Check if file exists
ls -la ./path/to/file.md
# Use absolute path
bun run tools/seeder/src/index.ts
# Enter: /absolute/path/to/file.md
# Check file permissions
chmod 644 ./path/to/file.mdCommon Issues:
- Relative paths are relative to project root, not seeder directory
- File must be readable
- File must have
.mdor.mdxextension
File Path Resolution
Understanding Paths:
./notes/file.md- Relative to project root../other/file.md- Relative to project root/absolute/path/file.md- Absolute path
Best Practice: Use paths relative to project root.
Date Format Issues
"Invalid date format"
Problem: Date doesn't match dd-mm-yyyy format.
Solution:
# Correct format examples:
06-11-2024 # November 6, 2024
01-01-2024 # January 1, 2024
31-12-2023 # December 31, 2023
# Common mistakes:
11-06-2024 # Wrong: This is November 6, not June 11
2024-11-06 # Wrong: Wrong order
11/06/2024 # Wrong: Uses slashes instead of dashesValidation Rules:
- Must use dashes (
-) - Day: 01-31 (valid for month)
- Month: 01-12
- Year: 4 digits
Invalid Date Values
Problem: Date is valid format but invalid value (e.g., Feb 30).
Solution:
- Check month has that many days
- February has 28/29 days
- April, June, September, November have 30 days
- Others have 31 days
Database Connection Issues
"Cannot connect to InstantDB"
Problem: Database connection fails.
Solution:
-
Check App ID:
echo $NEXT_PUBLIC_INSTANT_APP_ID -
Verify Network:
curl https://instantdb.com -
Check InstantDB Status:
- Visit InstantDB Dashboard
- Verify app is active
- Check for service status
-
Verify Schema:
- Ensure schema matches
apps/instantdb/src/api/db/schema.ts - Check table names and fields
- Ensure schema matches
Schema Mismatch
Problem: Schema doesn't match expected structure.
Solution:
- Check
apps/instantdb/src/api/db/schema.ts - Verify tables exist:
notes,folders,tasks - Verify fields match expected structure
- Update schema if needed
Note Creation Issues
Note Created But Not Visible
Problem: Note created successfully but doesn't appear in app.
Solution:
- Refresh App: Reload your Skriuw app
- Check Folder: Note might be in a folder
- Check Position: Note might be at end of list
- Verify Database: Check InstantDB dashboard
Position Issues
Problem: Note appears at wrong position.
Solution:
- Pinned Notes: Always position 0
- Custom Position: Other notes shift
- Automatic Position: Calculated from max position
- Folder-Specific: Positions are per-folder
Debugging:
- Check note position in InstantDB dashboard
- Verify folder assignment
- Check other notes' positions
- Recalculate if needed
Folder Issues
Folder Not Found
Problem: Selected folder doesn't exist.
Solution:
- List Folders: Use interactive mode to see available folders
- Check Dashboard: Verify folder exists in InstantDB
- Create Folder: Create folder in app first
- Use Root: Select "Root (no folder)" if needed
Folder Tree Not Displaying
Problem: Folders don't show in tree structure.
Solution:
- Check Database: Verify folders exist
- Check Schema: Ensure
parentfield exists - Refresh: Re-run seeder to reload folders
- Verify Structure: Check folder relationships
Task Linking Issues
Tasks Not Linking
Problem: Selected tasks don't link to note.
Solution:
- Verify Tasks Exist: Check tasks in InstantDB dashboard
- Check Schema: Ensure
tasks.notefield exists - Verify Transaction: Check transaction completed
- Refresh App: Reload to see linked tasks
Task Relationship Confusion
Important: Tasks link TO notes, not the reverse.
- Note doesn't have a
tasksfield - Task has a
notefield - Multiple tasks can link to one note
- One task can link to multiple notes
Move Operation Issues
"No notes found"
Problem: No notes exist to move.
Solution:
- Create Notes First: Use seed operation
- Check Database: Verify notes exist
- Check Folder: Notes might be in folders
- Verify Query: Check InstantDB query
Position Not Updating
Problem: Note moved but position doesn't change.
Solution:
- Check Transaction: Verify transaction completed
- Refresh App: Reload to see changes
- Check Folder: Position is folder-specific
- Verify Position: Check in InstantDB dashboard
Other Notes Not Shifting
Problem: When inserting at custom position, other notes don't shift.
Solution:
- This should happen automatically
- Check transaction completed successfully
- Verify
updateNotePositionsran - Check for errors in console
Performance Issues
Slow Operations
Problem: Seeder operations are slow.
Solution:
- Check Network: Slow connection to InstantDB
- Check Database Size: Large datasets take longer
- Check Queries: Complex queries may be slow
- Optimize: Consider batch operations
Timeout Errors
Problem: Operations timeout.
Solution:
- Check Network: Ensure stable connection
- Check InstantDB: Verify service status
- Retry: Operation may succeed on retry
- Reduce Data: Process smaller batches
Editor Issues
Editor Not Opening
Problem: Editor doesn't open for content input.
Solution:
# Set your editor
export EDITOR=cursor # or vim, nano, code, etc.
# Verify it's set
echo $EDITOR
# Try running seeder again
bun run tools/seeder/src/index.tsCommon Editors:
cursor- Cursor editorcode- VS Codevim- Vimnano- Nanonpx- Open with npm package
Editor Content Not Saving
Problem: Content entered in editor doesn't save.
Solution:
- Save Before Closing: Ensure editor saves on close
- Check Exit Code: Editor must exit with code 0
- Check File: Some editors save to temp file
- Use File Input: Use
--content-fileinstead
Transaction Issues
Partial Updates
Problem: Some changes apply but others don't.
Solution:
- Transactions are atomic (all or nothing)
- Check for errors in console
- Verify all operations completed
- Retry if transaction failed
Rollback Issues
Problem: Transaction fails but changes remain.
Solution:
- This shouldn't happen (transactions are atomic)
- Check InstantDB logs
- Verify transaction implementation
- Report as bug if occurs
Getting Help
Debug Mode
Enable verbose logging:
DEBUG=* bun run tools/seeder/src/index.tsCheck Logs
- Console Output: Check terminal for errors
- InstantDB Dashboard: Check database logs
- Network Tab: Check API requests (if using browser tools)
Common Error Messages
"Error: Invalid date format"
- Use
dd-mm-yyyyformat - Ensure valid date values
"Error: Failed to read file"
- Check file path
- Verify file exists
- Check permissions
"Error: NEXT_PUBLIC_INSTANT_APP_ID is not defined"
- Add to
.envfile - Verify variable name
- Restart terminal
Still Having Issues?
- Check Documentation: Review Usage Guide
- Verify Setup: Ensure Prerequisites are met
- Check Schema: Verify database schema matches
- Test Connection: Verify InstantDB connectivity
- Report Issue: Create issue with:
- Error message
- Steps to reproduce
- Environment details
- Expected vs actual behavior
Next Steps
- Review Usage Examples
- Explore All Features
- Build CLI Commands