{"record":{"id":"97a21e792733f7e1","repo":"ruvnet/ruflo","slug":"wasm-loader-detect-cycles-failed-using-fallback","errorCode":null,"errorMessage":"[WASM Loader] detect_cycles failed, using fallback:","messagePattern":"\\[WASM Loader\\] detect_cycles failed, using fallback:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/gastown-bridge/src/wasm-loader.ts","lineNumber":1019,"sourceCode":"export async function detectCycles(\n  nodes: string[],\n  edges: GraphEdge[]\n): Promise<CycleDetectionResult> {\n  const startTime = performance.now();\n\n  const wasmModule = await loadGnnWasm();\n\n  if (wasmModule) {\n    try {\n      const resultJson = wasmModule.detect_cycles(\n        JSON.stringify(nodes),\n        JSON.stringify(edges)\n      );\n      const result = JSON.parse(resultJson) as CycleDetectionResult;\n      recordTiming('detectCycles', startTime, true);\n      return result;\n    } catch (error) {\n      console.warn('[WASM Loader] detect_cycles failed, using fallback:', error);\n    }\n  }\n\n  // JavaScript fallback\n  const result = detectCyclesFallback(nodes, edges);\n  recordTiming('detectCycles', startTime, false);\n  return result;\n}\n\n/**\n * Calculate the critical path through a weighted dependency graph.\n * Uses WASM if available (150x faster), falls back to JavaScript.\n *\n * @param nodes - Array of node identifiers\n * @param edges - Array of edges (from -> to dependencies)\n * @param weights - Array of node weights (durations)\n * @returns Critical path result with path, duration, and slack times\n *","sourceCodeStart":1001,"sourceCodeEnd":1037,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/gastown-bridge/src/wasm-loader.ts#L1001-L1037","documentation":"Log warning in detectCycles: the WASM detect_cycles invocation failed; cycle detection reruns through the JavaScript fallback implementation.","triggerScenarios":"Thrown at v3/plugins/gastown-bridge/src/wasm-loader.ts:1019 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the graph input and the WASM detect_cycles error; the JS fallback is used."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}