ruvnet/ruflo · error

[WASM Loader] cook_formula failed, using fallback:

Error message

[WASM Loader] cook_formula failed, using fallback:

What it means

Log warning in cookFormula: the WASM cook_formula invocation threw or returned unparsable JSON; the JS cooking fallback computes the formula result instead.

Source

Thrown at v3/plugins/gastown-bridge/src/wasm-loader.ts:859

    return cached;
  }

  // Use batch deduplication for concurrent requests
  return cookDedup.dedupe(cacheKey, async () => {
    const wasmModule = await loadFormulaWasm();

    if (wasmModule) {
      try {
        const resultJson = wasmModule.cook_formula(
          JSON.stringify(formula),
          JSON.stringify(vars)
        );
        const result = JSON.parse(resultJson) as Formula;
        cookCache.set(cacheKey, result);
        recordTiming('cookFormula', startTime, true);
        return result;
      } catch (error) {
        console.warn('[WASM Loader] cook_formula failed, using fallback:', error);
      }
    }

    // JavaScript fallback
    const result = cookFormulaFallback(formula, vars);
    cookCache.set(cacheKey, result);
    recordTiming('cookFormula', startTime, false);
    return result;
  });
}

/**
 * Batch cook multiple formulas with corresponding variables.
 * Uses WASM if available (352x faster), falls back to JavaScript.
 *
 * @param formulas - Array of formulas to cook
 * @param varsArray - Array of variable objects (one per formula)
 * @returns Array of cooked formulas

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Check the formula input and the WASM cook error; the JS fallback is used — verify formula fields are valid.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at v3/plugins/gastown-bridge/src/wasm-loader.ts:859 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/830b73093350b15d. Report an issue: GitHub.