{"record":{"id":"830b73093350b15d","repo":"ruvnet/ruflo","slug":"wasm-loader-cook-formula-failed-using-fallback","errorCode":null,"errorMessage":"[WASM Loader] cook_formula failed, using fallback:","messagePattern":"\\[WASM Loader\\] cook_formula failed, using fallback:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/gastown-bridge/src/wasm-loader.ts","lineNumber":859,"sourceCode":"    return cached;\n  }\n\n  // Use batch deduplication for concurrent requests\n  return cookDedup.dedupe(cacheKey, async () => {\n    const wasmModule = await loadFormulaWasm();\n\n    if (wasmModule) {\n      try {\n        const resultJson = wasmModule.cook_formula(\n          JSON.stringify(formula),\n          JSON.stringify(vars)\n        );\n        const result = JSON.parse(resultJson) as Formula;\n        cookCache.set(cacheKey, result);\n        recordTiming('cookFormula', startTime, true);\n        return result;\n      } catch (error) {\n        console.warn('[WASM Loader] cook_formula failed, using fallback:', error);\n      }\n    }\n\n    // JavaScript fallback\n    const result = cookFormulaFallback(formula, vars);\n    cookCache.set(cacheKey, result);\n    recordTiming('cookFormula', startTime, false);\n    return result;\n  });\n}\n\n/**\n * Batch cook multiple formulas with corresponding variables.\n * Uses WASM if available (352x faster), falls back to JavaScript.\n *\n * @param formulas - Array of formulas to cook\n * @param varsArray - Array of variable objects (one per formula)\n * @returns Array of cooked formulas","sourceCodeStart":841,"sourceCodeEnd":877,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/gastown-bridge/src/wasm-loader.ts#L841-L877","documentation":"Log warning in cookFormula: the WASM cook_formula invocation threw or returned unparsable JSON; the JS cooking fallback computes the formula result instead.","triggerScenarios":"Thrown at v3/plugins/gastown-bridge/src/wasm-loader.ts:859 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the formula input and the WASM cook error; the JS fallback is used — verify formula fields are valid."],"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-14T00:17:10.932Z"}