{"record":{"id":"12eb8b0555511eb8","repo":"neoclide/coc.nvim","slug":"watchman-not-found","errorCode":null,"errorMessage":"watchman not found","messagePattern":"watchman not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/extension/manager.ts","lineNumber":636,"sourceCode":"        } else {\n          void window.showWarningMessage(`Extension ${id} not found`)\n        }\n      }\n    }\n  }\n\n  public async watchExtension(id: string): Promise<void> {\n    let item = this.getExtension(id)\n    if (!item) throw new Error(`extension ${id} not found`)\n    if (id.startsWith('single-')) {\n      void window.showInformationMessage(`watching ${item.filepath}`)\n      this.disposables.push(watchFile(item.filepath, async () => {\n        await this.loadExtensionFile(item.filepath)\n        void window.showInformationMessage(`reloaded ${id}`)\n      }, global.__TEST__ === true))\n    } else {\n      let client = await workspace.fileSystemWatchers.createClient(item.directory, true)\n      if (!client) throw new Error('watchman not found')\n      void window.showInformationMessage(`watching ${item.directory}`)\n      client.subscribe('**/*.js', async () => {\n        this.reloadExtension(id).then(() => {\n          void window.showInformationMessage(`reloaded ${id}`)\n        }, onUnexpectedError)\n      })\n    }\n  }\n\n  /**\n   * load extension in folder or file\n   */\n  public async load(filepath: string, active: boolean, options?: ExtensionLoadOptions): Promise<ExportExtension> {\n    let name: string\n    if (options?.sourceCode) {\n      let extensionRoot = options.extensionRoot ?? filepath\n      let obj = loadJson(path.join(extensionRoot, 'package.json')) as any\n      name = obj.name","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/neoclide/coc.nvim/blob/50e974d9692461a69147d5cab146a8d3e439abe4/src/extension/manager.ts#L618-L654","documentation":"For non-single-file extensions, watchExtension relies on workspace.fileSystemWatchers.createClient(directory, true), which returns null when no watchman client can be established (watchman binary missing or service unreachable). The manager then throws `watchman not found` because folder watching cannot proceed without it.","triggerScenarios":"watchExtension(id) on a folder extension when watchman is not installed on PATH, the watchman service fails to start, or the watcher client cannot be created (e.g. permission or socket issues in the watched directory).","commonSituations":"Fresh machine without watchman installed; watchman installed but its state dir corrupted or server not running; WSL/container images lacking watchman; directory on a filesystem watchman cannot watch (network mounts).","solutions":["Install watchman (e.g. `brew install watchman` or your package manager) and ensure `watchman --version` works in the shell coc runs in","Start/repair the watchman service: run `watchman watch <directory>` and check `watchman get-sockname` for errors","If watchman cannot be used, fall back to reloading the extension manually instead of watchExtension","Check the directory is on a local filesystem watchman supports (not NFS/network mounts)"],"exampleFix":"// before: watchman missing\nawait manager.watchExtension('coc-myext') // throws 'watchman not found'\n// after (shell)\nbrew install watchman  # or apt install watchman\nwatchman watch ~/project  # verify service works\n// then retry watchExtension","handlingStrategy":"fallback","validationCode":"import { execFileSync } from 'child_process'\nfunction watchmanAvailable(): boolean {\n  try { execFileSync('watchman', ['--version'], { stdio: 'ignore' }); return true }\n  catch { return false }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await manager.watchExtension(id)\n} catch (e) {\n  if (e.message === 'watchman not found') {\n    logger.warn('watchman unavailable; manual reload required')\n  } else throw e\n}","preventionTips":["Install watchman in dev environments/CI images (brew/apt install watchman)","Verify `watchman --version` in the same shell/environment coc runs in","Avoid watching directories on network filesystems","Provide a manual-reload fallback path when watchman is absent"],"tags":["watchman","filesystem-watcher","environment"],"backgroundTag":"watchman-not-found","analyzedSha":"50e974d9692461a69147d5cab146a8d3e439abe4","analyzedAt":"2026-08-31T11:17:23.966Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}