{"record":{"id":"a865409fb165663a","repo":"Fission-AI/OpenSpec","slug":"cannot-verify-dangling-symbolic-link-existingpa","errorCode":null,"errorMessage":"Cannot verify dangling symbolic link: ${existingPath}","messagePattern":"Cannot verify dangling symbolic link: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/utils/file-system.ts","lineNumber":170,"sourceCode":"    let existingPath = targetPath;\n    const missingSegments: string[] = [];\n\n    while (true) {\n      try {\n        // lstat distinguishes a missing path from a dangling symlink. A\n        // dangling link cannot be proven confined, so realpath must fail it.\n        nodeFs.lstatSync(existingPath);\n        const canonicalExisting = nodeFs.realpathSync.native(existingPath);\n        return path.resolve(canonicalExisting, ...missingSegments);\n      } catch (error) {\n        const code = (error as NodeJS.ErrnoException).code;\n        if (code !== 'ENOENT') {\n          throw error;\n        }\n\n        try {\n          if (nodeFs.lstatSync(existingPath).isSymbolicLink()) {\n            throw new Error(`Cannot verify dangling symbolic link: ${existingPath}`);\n          }\n        } catch (lstatError) {\n          if ((lstatError as NodeJS.ErrnoException).code !== 'ENOENT') {\n            throw lstatError;\n          }\n        }\n\n        const parent = path.dirname(existingPath);\n        if (parent === existingPath) {\n          throw new Error(`Cannot resolve an existing parent for ${targetPath}`);\n        }\n        missingSegments.unshift(path.basename(existingPath));\n        existingPath = parent;\n      }\n    }\n  }\n\n  private static isWindowsBasePath(basePath: string): boolean {","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/utils/file-system.ts#L152-L188","documentation":"Error \"Cannot verify dangling symbolic link: ${existingPath}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/utils/file-system.ts:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}