From bc58711617a2dbb0f5bb0d1b116a12de15b86f69 Mon Sep 17 00:00:00 2001 From: Axiom Bot <0xAxiom@users.noreply.github.com> Date: Thu, 30 Apr 2026 13:10:33 -0700 Subject: [PATCH] fix: replace illegal await-in-constructor with static crypto import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Web3Pipeline constructor used 'await import("crypto")' which throws SyntaxError: Unexpected reserved word at runtime because constructors are synchronous and cannot use await. This broke the entire Web3 Factory pipeline on any invocation. Fix: add 'import * as crypto from "crypto"' at the top of the file (matching the pattern already used in prompt_enforcer.ts) and remove the dynamic import. No behaviour change — crypto is a built-in module. --- dapp-factory/pipeline/web3_pipeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dapp-factory/pipeline/web3_pipeline.ts b/dapp-factory/pipeline/web3_pipeline.ts index 2d730f87..fb0064a8 100644 --- a/dapp-factory/pipeline/web3_pipeline.ts +++ b/dapp-factory/pipeline/web3_pipeline.ts @@ -1,3 +1,4 @@ +import * as crypto from 'crypto'; import * as fs from 'fs'; import * as path from 'path'; import { PromptEnforcer, executeStageWithPrompt } from './prompt_enforcer'; @@ -27,7 +28,6 @@ export class Web3Pipeline { // Generate run ID if not provided const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); - const crypto = await import('crypto'); const ideaHash = crypto .createHash('md5') .update(config.idea)