mirror of
https://github.com/LukeHagar/volar-docs.git
synced 2025-12-06 04:22:01 +00:00
2.8 KiB
2.8 KiB
Troubleshooting & FAQ
This FAQ aggregates the most common VolarJS issues reported by users, along with actionable fixes and references to relevant guides.
Duplicate Diagnostics
Symptom: Same error appears twice (one from Volar, one from TypeScript).
Fix: Enable Take Over Mode or disable the built-in TypeScript server.
{
"volar.takeOverMode.enabled": true,
"typescript.tsserver.enable": false
}
For Neovim/Sublime, ensure only Volar’s LSP client handles .ts/.js when Take Over Mode is on.
“Cannot find module '@/…'”
- Verify
tsconfig.jsonincludesbaseUrl+paths. - Check
Output ▸ Volarto confirm the intendedtsconfigis loaded. - In monorepos, enable project references (
"composite": true) or add each package tsconfig to the workspace.
Schema Fetch Failures / Offline Mode
- Cache schemas locally (e.g.,
~/.cache/volar-schemas) or bundle them. - Provide a configuration flag like
volarJsonYaml.schemas.allowRemote = false. - Log failures via
connection.console.warnso users know which URI failed.
Slow Diagnostics
Checklist:
- Increase
VALIDATION_DELAY(JSON/YAML example) to reduce frequency. - Disable unused services (Prettier, Emmet) if not required.
- Profile with
VOLAR_TRACE=log+node --prof; see Performance & Debugging. - Align TypeScript + Volar versions.
Take Over Mode Not Activating
- Disable VS Code’s “TypeScript and JavaScript Language Features” extension.
- Set
volar.takeOverMode.enabled = trueand restart. - Ensure
typescript.tsdkpoints to the correct TS install if needed.
Missing Hover/Completion in Monaco
- Confirm
@volar/monacoworker bundle loads (check console). - Ensure TypeScript is available inside the worker (
tsglobal). - Version-match server + worker bundles.
Neovim “node: command not found”
- Install Node and set the
cmdinlspconfigto{ 'node', '/path/to/volar/server.js', '--stdio' }. - Consider bundling the server as an executable (
pkg) for users without Node.
CLI Always Succeeds
- Exit with code
1when diagnostics include severity Error; see CLI Integration. - Provide
--max-warningsif teams want warning thresholds.
Log Locations
| Editor | Location |
|---|---|
| VS Code | Output ▸ Volar |
| Sublime | View ▸ Show Console |
| Neovim | Plugin-specific log file (~/.cache/volar/log.txt) |
| CLI | stdout/stderr (support --log-file) |
Reporting Issues
Include editor/version, Node/TS/Volar versions, tsconfig, reproduction steps, and logs. Reference this FAQ so maintainers can triage quickly.