{"record":{"id":"c3f4498734af9c14","repo":"facebook/flow","slug":"flow-version-version-doesn-t-support-flow-lsp","errorCode":null,"errorMessage":"Flow version ${version} doesn't support 'flow lsp'. Please upgrade flow to version ${FLOW_VERSION_FOR_LSP}.","messagePattern":"Flow version (.+?) doesn't support 'flow lsp'\\. Please upgrade flow to version (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/flow-for-vscode/src/utils/assertFlowSupportsLSP.ts","lineNumber":14,"sourceCode":"/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport checkFlowVersionSatisfies from './checkFlowVersionSatisfies';\n\nconst FLOW_VERSION_FOR_LSP = '>=0.75';\n\nexport default function assertFlowSupportsLSP(version: string): void {\n  if (!checkFlowVersionSatisfies(version, FLOW_VERSION_FOR_LSP)) {\n    throw new Error(\n      `Flow version ${version} doesn't support 'flow lsp'.` +\n        ` Please upgrade flow to version ${FLOW_VERSION_FOR_LSP}.`,\n    );\n  }\n}\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/facebook/flow/blob/d1341dac899a79c027762f6b423d896045287620/packages/flow-for-vscode/src/utils/assertFlowSupportsLSP.ts#L1-L20","documentation":"The VS Code Flow extension only speaks the 'flow lsp' protocol with Flow >= 0.75. Before starting the language server it checks the resolved flow binary's version via checkFlowVersionSatisfies(version, '>=0.75') and throws this error when the check fails.","triggerScenarios":"Opening a project with the Flow VS Code extension where the discovered flow binary (flow-bin dependency, pathToFlow setting, or bundled flow) reports a version below 0.75.","commonSituations":"Legacy projects pinned to ancient flow-bin (0.5x); a stale global `flow` on PATH shadowing the project binary; pathToFlow pointing at an old binary; monorepos resolving an old flow from the workspace root.","solutions":["Upgrade the project's flow-bin (`npm install --save-dev flow-bin@latest`) and update the .flowconfig [version] header to match","Check the extension's output channel for which flow binary was picked; fix `flow.pathToFlow` or PATH so a current binary is found","If `flow version` output was misparsed (custom builds), report the exact version string to the extension repo"],"exampleFix":"# before\n# .flowconfig\n[version]\n0.53.0\n# package.json: \"flow-bin\": \"^0.53.0\"\n\n# after\n[version]\n^0.230.0\n# npm install --save-dev flow-bin@0.230.0","handlingStrategy":"validation","validationCode":"import {execFileSync} from 'child_process';\nimport semver from 'semver';\n\nfunction flowSupportsLsp(flowPath: string): boolean {\n  try {\n    const v = execFileSync(flowPath, ['version'], {encoding: 'utf8'})\n      .match(/(\\d+\\.\\d+(?:\\.\\d+)?/)?.[1];\n    return v != null && semver.gte(v, '0.75.0');\n  } catch {\n    return false;\n  }\n}","typeGuard":"function satisfiesLsp(version: string | null | undefined): boolean {\n  if (version == null) return false;\n  const coerced = semver.coerce(version);\n  return coerced != null && semver.satisfies(coerced, '>=0.75');\n}","tryCatchPattern":null,"preventionTips":["Keep flow-bin modern; assert `npx flow version` in CI","Fix `flow.pathToFlow` so an old global binary cannot be picked up","Match .flowconfig [version] with the installed flow-bin"],"tags":["flow","vscode","lsp","version","extension"],"backgroundTag":"tool-version-too-old","analyzedSha":"d1341dac899a79c027762f6b423d896045287620","analyzedAt":"2026-08-17T00:07:02.212Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}