ruvnet/ruflo · error

Failed to initialize WASM, using fallback

Error message

Failed to initialize WASM, using fallback

What it means

Log warning in initialize: locating or loading the economy WASM module failed, so the bridge marks itself initialized anyway and runs the pure-JavaScript implementation of the economic calculations.

Source

Thrown at v3/plugins/financial-risk/src/bridges/economy-bridge.ts:293

        this.randomSeed = config.randomSeed;
      }
    }

    try {
      const wasmPath = await this.resolveWasmPath();
      if (wasmPath) {
        this.wasmModule = await this.loadWasmModule(wasmPath);
        this.logger.info('Economy WASM module initialized', {
          precision: this.config.precision,
          defaultScenarios: this.config.defaultScenarios,
        });
      } else {
        this.logger.warn('WASM module not available, using JavaScript fallback');
      }

      this.initialized = true;
    } catch (error) {
      this.logger.warn('Failed to initialize WASM, using fallback', {
        error: error instanceof Error ? error.message : String(error),
      });
      this.initialized = true;
    }
  }

  /**
   * Calculate Value at Risk
   */
  async calculateVar(returns: Float32Array, confidence: number): Promise<number> {
    if (!this.initialized) {
      throw new Error('Economy bridge not initialized');
    }

    if (this.wasmModule) {
      return this.wasmModule.calculate_var(returns, confidence);
    }

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Check the WASM module load error; the JS fallback preserves correctness at lower speed, so rebuild or reinstall the WASM package to restore performance.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at v3/plugins/financial-risk/src/bridges/economy-bridge.ts:293 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/bfb2f709a8c3b975. Report an issue: GitHub.