7. Troubleshooting
Common integration failures and fixes for the Ledger Multisig API tutorials.
TypeError: SafeApiKit is not a constructor
Cause
ESM/CJS interop differences in @safe-global/api-kit and @safe-global/protocol-kit.
Fix
Use interop-safe constructor resolution:
import SafeApiKitModule from "@safe-global/api-kit";
const SafeApiKit =
typeof SafeApiKitModule === "function"
? SafeApiKitModule
: (SafeApiKitModule as unknown as { default: typeof SafeApiKitModule }).default;Apply the same pattern for SafeModule from @safe-global/protocol-kit.
executeTransaction returns hash but tx failed
Cause
executeTransaction can return a submitted hash even when the EVM call reverts.
Fix
Always wait for receipt and check status:
const receipt = await publicClient.waitForTransactionReceipt({
hash: executionResult.hash as `0x${string}`,
timeout: 120_000,
});
if (receipt.status === "reverted") {
throw new Error("Transaction reverted on-chain");
}See also
Tutorial index
Last updated