{"record":{"id":"fe34b0150d35ecd4","repo":"FuelLabs/fuels-ts","slug":"missing-connector","errorCode":"MISSING_CONNECTOR","errorMessage":"A connector is required to sign messages.","messagePattern":"A connector is required to sign messages\\.","errorType":"exception","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/account/src/account.ts","lineNumber":1073,"sourceCode":"    });\n\n    return {\n      ...txCost,\n      requiredQuantities,\n    };\n  }\n\n  /**\n   * Sign a message from the account via the connector.\n   *\n   * @param message - the message to sign.\n   * @returns a promise that resolves to the signature.\n   *\n   * @hidden\n   */\n  async signMessage(message: HashableMessage): Promise<string> {\n    if (!this._connector) {\n      throw new FuelError(ErrorCode.MISSING_CONNECTOR, 'A connector is required to sign messages.');\n    }\n    return this._connector.signMessage(this.address.toString(), message);\n  }\n\n  /**\n   * Signs a transaction from the account via the connector..\n   *\n   * @param transactionRequestLike - The transaction request to sign.\n   * @returns A promise that resolves to the signature of the transaction.\n   */\n  async signTransaction(\n    transactionRequestLike: TransactionRequestLike,\n    connectorOptions: AccountSendTxParams = {}\n  ): Promise<string | TransactionRequest> {\n    if (!this._connector) {\n      throw new FuelError(\n        ErrorCode.MISSING_CONNECTOR,\n        'A connector is required to sign transactions.'","sourceCodeStart":1055,"sourceCodeEnd":1091,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/account/src/account.ts#L1055-L1091","documentation":"Thrown by Account.signMessage when the account has no connector attached. The Account class signs via an injected FuelConnector (a wallet extension); without one it cannot produce a signature because it holds no private key material itself. This separates read-only/address-only accounts from sign-capable accounts.","triggerScenarios":"Constructing an Account or WalletLocked directly from an address (new Account(address, provider) or WalletLocked), then calling account.signMessage(msg). Also occurs if connect(connector) was never called, or the connector reference was cleared.","commonSituations":"Using a 'view-only' wallet instance (address only) for signing, forgetting to call account.connect(connector) after creation, or mixing up WalletLocked (address) with WalletUnlocked/BaAccount that can actually sign.","solutions":["Use an unlocked wallet that holds a private key for signing: Wallet.fromPrivateKey or WalletUnlocked, instead of an address-only Account.","If you intend to sign via an extension, call account.connect(fuelConnector) (or obtain the account from fuel.getWallet) before signMessage.","Guard the call site: if (!account.connector) throw a clearer domain error explaining signing is unavailable."],"exampleFix":"// before\nconst account = new Account(address, provider);\nawait account.signMessage(msg);\n\n// after\nconst account = Wallet.fromPrivateKey(privateKey, provider);\nawait account.signMessage(msg);","handlingStrategy":"type-guard","validationCode":"// Ensure the account can sign before calling signMessage\nasync function canSign(account: Account): Promise<boolean> {\n  return Boolean((account as any)._connector) || account instanceof BaseWalletUnlocked;\n}","typeGuard":"import { BaseWalletUnlocked, Account } from 'fuels';\n\nfunction isSignCapable(account: Account): boolean {\n  return (account as any)._connector != null || account instanceof BaseWalletUnlocked;\n}","tryCatchPattern":"try {\n  const sig = await account.signMessage(message);\n} catch (e) {\n  if (e instanceof FuelError && e.code === ErrorCode.MISSING_CONNECTOR) {\n    // prompt user to connect wallet, or switch to WalletUnlocked\n  } else throw e;\n}","preventionTips":["Use Wallet.fromPrivateKey or WalletUnlocked for signing, not an address-only Account.","For connector signing, call account.connect(connector) or obtain via fuel.getWallet.","Branch your code on whether the account is sign-capable before signing."],"tags":["account","signing","connector","authentication"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}