{"record":{"id":"bfb2f709a8c3b975","repo":"ruvnet/ruflo","slug":"failed-to-initialize-wasm-using-fallback","errorCode":null,"errorMessage":"Failed to initialize WASM, using fallback","messagePattern":"Failed to initialize WASM, using fallback","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/financial-risk/src/bridges/economy-bridge.ts","lineNumber":293,"sourceCode":"        this.randomSeed = config.randomSeed;\n      }\n    }\n\n    try {\n      const wasmPath = await this.resolveWasmPath();\n      if (wasmPath) {\n        this.wasmModule = await this.loadWasmModule(wasmPath);\n        this.logger.info('Economy WASM module initialized', {\n          precision: this.config.precision,\n          defaultScenarios: this.config.defaultScenarios,\n        });\n      } else {\n        this.logger.warn('WASM module not available, using JavaScript fallback');\n      }\n\n      this.initialized = true;\n    } catch (error) {\n      this.logger.warn('Failed to initialize WASM, using fallback', {\n        error: error instanceof Error ? error.message : String(error),\n      });\n      this.initialized = true;\n    }\n  }\n\n  /**\n   * Calculate Value at Risk\n   */\n  async calculateVar(returns: Float32Array, confidence: number): Promise<number> {\n    if (!this.initialized) {\n      throw new Error('Economy bridge not initialized');\n    }\n\n    if (this.wasmModule) {\n      return this.wasmModule.calculate_var(returns, confidence);\n    }\n","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/financial-risk/src/bridges/economy-bridge.ts#L275-L311","documentation":"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.","triggerScenarios":"Thrown at v3/plugins/financial-risk/src/bridges/economy-bridge.ts:293 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the WASM module load error; the JS fallback preserves correctness at lower speed, so rebuild or reinstall the WASM package to restore performance."],"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"}