URL: http://localhost:5173/wysiwyg
When the page loads and you type, you should see:
[WorkerManager] ✓ CalcMark worker initialized
[Worker] Initializing CalcMark WASM...
[Worker] ✓ CalcMark WASM initialized
[WYSIWYG] evaluateDocument: starting
[Worker] Evaluating input, length: <number>
[Worker] ✓ Evaluation complete, sending results
[WorkerManager] Received result for request <id>
[WYSIWYG] evaluateDocument: got results
If you see module resolution errors:
[WorkerManager] Worker error: Failed to fetch dynamically imported module
→ The worker can't load the WASM files. This is a Vite bundling issue.
If you see WASM initialization errors:
[Worker] Error: CalcMark API not initialized
→ The Go WASM runtime isn't loading properly.
If you see no logs at all: → The worker isn't being created. Check browser DevTools → Sources → Web Workers
Symptom: The rendered/highlighted text appears shifted up and to the right
How to verify: Type # Budget Calculator and compare textarea vs overlay positions
Symptom: Cursor appears in wrong location or is too tall How to verify: Click in the middle of a line - cursor should appear where you clicked
Symptom: Text appears plain, no markdown rendering or calc highlighting
How to verify: Type x = 5 - should show syntax highlighted after 150ms debounce
Open Console and run:
// Check if worker is running
console.log(window.__workerManager);
// Manually trigger evaluation
const textarea = document.querySelector('.raw-textarea');
console.log('Textarea value:', textarea.value);→ Issue is with alignment CSS or cursor positioning logic
→ Need to fix Vite worker bundling config
→ Need to check WASM file paths and Go runtime
Please screenshot:
- Browser console - full log output
- DevTools Sources tab - Web Workers section
- The editor - showing the misalignment/cursor issues
This will help me identify the exact issue!