# TypeError: Cannot read property 'padStart' of null

**URL:** <https://forum.flow.com/t/typeerror-cannot-read-property-padstart-of-null/1919>\
**Category:** ⚙️ Flow SDKs\
**Created:** [May 13, 2021, 3:19pm UTC](https://forum.flow.com/t/typeerror-cannot-read-property-padstart-of-null/1919 "2021-05-13T15:19:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhaankit](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/jhaankit/32/459_2.png) [@jhaankit](https://forum.flow.com/u/jhaankit)\
**Post date:** [May 13, 2021, 3:19pm UTC](https://forum.flow.com/t/typeerror-cannot-read-property-padstart-of-null/1919/1 "2021-05-13T15:19:03Z")

</div>

I am new to flow and trying to do a transaction.

When i initiate the transection it makes same api call 6 time, not sure why?  
Then i get TypeError: Cannot read property ‘padStart’ of null.

```
send-get-account.js:12 Uncaught (in promise) TypeError: Cannot read property 'padStart' of null
at send-get-account.js:12

```

Please help me to figure out what is happening here, looks like the issue is in JS SDK.

 ![Screenshot 2021-05-13 at 8.47.42 PM](https://us1.discourse-cdn.com/flex022/uploads/flow/original/1X/02ee0ce47499358cad5163131e6c9e02b2871e89.png)

---

<div class="post-metadata">

**Author:** ![flowjosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/flowjosh/32/362_2.png) [@flowjosh](https://forum.flow.com/u/flowjosh)\
**Post date:** [May 18, 2021, 6:59pm UTC](https://forum.flow.com/t/typeerror-cannot-read-property-padstart-of-null/1919/2 "2021-05-18T18:59:38Z")

</div>

@gregsantos @JeffreyDoyle Any ideas for what is happening here?

---

<div class="post-metadata">

**Author:** ![namadaz](https://avatars.discourse-cdn.com/v4/letter/n/4af34b/32.png) [@namadaz](https://forum.flow.com/u/namadaz)\
**Post date:** [May 23, 2021, 6:11pm UTC](https://forum.flow.com/t/typeerror-cannot-read-property-padstart-of-null/1919/3 "2021-05-23T18:11:47Z")

</div>

@jhaankit I was running into this issue as well, was able to resolve.

I believe in my case, the root cause of this issue was incorrectly setting the Authorization function when calling `fcl.payer`, `fcl.proposer`, `fcl.authorizations`. I was initially rolling my own Authorization function modeling off of [this post](http://forum.flow.com/t/deploying-contracts-and-signing-transaction-from-node/657) and the Kitty-Items implementation shown in `authorizeMinter()` [here](https://github.com/onflow/kitty-items/blob/master/api/src/services/flow.ts).

I’ve since made the following update to my transaction code:

```auto
  const txId = await fcl
    .send([
      CODE,
      fcl.payer(sdk.authorization(process.env.FLOW_SMART_CONTRACT_PROFILE, signingFunction, 0)),
      fcl.proposer(sdk.authorization(process.env.FLOW_SMART_CONTRACT_PROFILE, signingFunction, 0)),
      fcl.authorizations([sdk.authorization(process.env.FLOW_SMART_CONTRACT_PROFILE, signingFunction, 0)]),
      fcl.limit(35),
    ])
    .then(fcl.decode)

```

I’m using `fcl` for scaffolding the transaction, then just using the `sdk` for its `authorization` method.

My `signingFunction` is implemented following the post I linked above.

---

<div class="post-metadata">

**Author:** ![Kartik](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@Kartik](https://forum.flow.com/u/Kartik)\
**Post date:** [July 15, 2021, 12:35pm UTC](https://forum.flow.com/t/typeerror-cannot-read-property-padstart-of-null/1919/4 "2021-07-15T12:35:47Z")

</div>

Hi @namadaz , Thanks for this answer. I was really looking for this. I am still facing the same error. Can you provide me your authorisation code and signing function ? I have followed both of the posts which you have mentioned but still found no success in it. Thanks in advance. Please help me out.  
@gregsantos@JeffreyDoyle @flowjosh @qvvg I need your help guys.
