# Getting error in sending transaction

**URL:** <https://forum.flow.com/t/getting-error-in-sending-transaction/1977>\
**Category:** Flow JavaScript SDK\
**Tags:** flow-sdk-js\
**Created:** [May 25, 2021, 1:01pm UTC](https://forum.flow.com/t/getting-error-in-sending-transaction/1977 "2021-05-25T13:01:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadyr6](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@shadyr6](https://forum.flow.com/u/shadyr6)\
**Post date:** [May 25, 2021, 1:01pm UTC](https://forum.flow.com/t/getting-error-in-sending-transaction/1977/1 "2021-05-25T13:01:15Z")

</div>

import React, {useState} from “react”

import \* as fcl from “@onflow/fcl”

import styled from ‘styled-components’

import \* as t from “@onflow/types”

import \* as sdk from “@onflow/sdk”

const simpleTransaction = fcl.cdc`

```
import HelloWorld from 0x4fc019cea9fc4817

transaction {

    prepare(account: AuthAccount) {

      let capability = account.link<&HelloWorld.HelloAsset>(/public/Hello, target: /storage/Hello)

      let helloReference = capability!.borrow()

        ?? panic("Could not borrow a reference to the hello capability")

      log(helloReference.hello())

    }

  }

```

`

const SendTransaction = () =\> {

const [status, setStatus] = useState(“Not started”)

const [transaction, setTransaction] = useState(null)

const sendTransaction = async (event) =\> {

```
event.preventDefault()

setStatus("Resolving...")

const blockResponse = await fcl.send([

  fcl.getLatestBlock(),

])

const block = await fcl.decode(blockResponse)

try {

  const tx = await fcl.send([

    fcl.transaction(simpleTransaction),

    fcl.proposer(fcl.currentUser().authorization),

    fcl.payer(fcl.currentUser().authorization),

    fcl.ref(block.id),

  ])

  const { transactionId } = tx

  setStatus(`Transaction (${transactionId}) sent, waiting for confirmation`)

  const unsub = fcl

    .tx(transactionId)

    .subscribe(transaction => {

      setTransaction(transaction)

      if (fcl.tx.isSealed(transaction)) {

        setStatus(`Transaction (${transactionId}) is Sealed`)

        unsub()

      }

    })

} catch (error) {

  console.error(error)

  setStatus("Transaction failed")

}

```

}

return (

```
<Card>

  <Header>send transaction</Header>

  <Code>{simpleTransaction}</Code>

  <button onClick={sendTransaction}>

    Send

  </button>

  <Code>Status: {status}</Code>

  {transaction && <Code>{JSON.stringify(transaction, null, 2)}</Code>}

</Card>

```

)

}

export default SendTransaction

but getting error

[Error Code: 1101] cadence runtime error Execution failed:\nerror: authorizer count mismatch for transaction: expected 1, got 0\n–\> d318adf48d25986c4d63fea82ca201236256dcaf332459684c1379724bf3ea90\n",

can anybody help me

---

<div class="post-metadata">

**Author:** ![qvvg](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/qvvg/32/78_2.png) [@qvvg](https://forum.flow.com/u/qvvg)\
**Post date:** [May 28, 2021, 1:00am UTC](https://forum.flow.com/t/getting-error-in-sending-transaction/1977/2 "2021-05-28T01:00:54Z")

</div>

Your cadence prepare statement specifies an auth account, but when you are building the transaction you arent supplying an authorizer.

```auto
transaction {
  prepare(account: AuthAccount) {
     //. ^---- Your transaction needs to deal with this.
  }
}

```

You can add an authorizer with the `fcl.authorizations` builder. It expects an array of Authorization Functions, the order of the array lines up with the order of AuthAccounts passed into the prepare statement.

You need to add

```javascript
  fcl.send([
    /// other stuff
      fcl.proposer(fcl.currentUser().authorization),
      fcl.payer(fcl.currentUser().authorization),
      fcl.authorizations([ // add this
        fcl.currentUser().authorization // add this
      ]), // add this
    /// other stuff
  ])

```

---

<div class="post-metadata">

**Author:** ![shadyr6](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@shadyr6](https://forum.flow.com/u/shadyr6)\
**Post date:** [May 28, 2021, 9:55am UTC](https://forum.flow.com/t/getting-error-in-sending-transaction/1977/3 "2021-05-28T09:55:59Z")

</div>

Yup it worked Thank you for helping out
