fcl-js icon indicating copy to clipboard operation
fcl-js copied to clipboard

TypeError: Cannot read property 'padStart' of null

Open huyanbin opened this issue 4 years ago • 3 comments

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

"@onflow/fcl": "0.0.77",
"@onflow/types": "0.0.5",

TypeError: Cannot read property 'padStart' of null at Ce (D:\nodejs\node_modules@onflow\sdk\dist\sdk.js:1:10721) at D:\nodejs\node_modules@onflow\sdk\dist\sdk.js:1:19358 at D:\nodejs\node_modules@onflow\sdk\dist\sdk.js:1:19526 at processTicksAndRejections (internal/process/task_queues.js:95:5)

i was readed this page https://forum.onflow.org/t/typeerror-cannot-read-property-padstart-of-null/1919 https://githubmemory.com/repo/onflow/flow-js-sdk/issues/639

huyanbin avatar Nov 03 '21 04:11 huyanbin

I found that when sending transactions, the program will obtain the account information many times. It can be obtained for the first time, but it can't go to the address later. [ account: { addr: null }] the first time:

{
  tag: 'GET_ACCOUNT',
  assigns: {},
  status: 'OK',
  reason: null,
  accounts: {},
  params: {},
  arguments: {},
  message: {
    cadence: null,
    refBlock: null,
    computeLimit: null,
    proposer: null,
    payer: null,
    authorizations: [],
    params: [],
    arguments: []
  },
  proposer: null,
  authorizations: [],
  payer: null,
  events: { eventType: null, start: null, end: null, blockIds: [] },
  transaction: { id: null },
  block: { id: null, height: null, isSealed: null },
  account: { addr: '47068a56438c70fc' },
  collection: { id: null }
}

then

{ tag: 'GET_ACCOUNT', assigns: {}, status: 'OK', reason: null, accounts: {}, params: {}, arguments: {}, message: { cadence: null, refBlock: null, computeLimit: null, proposer: null, payer: null, authorizations: [], params: [], arguments: [] }, proposer: null, authorizations: [], payer: null, transaction: { id: null }, block: { id: null, height: null, isSealed: null }, account: { addr: null }, collection: { id: null } }

huyanbin avatar Nov 03 '21 15:11 huyanbin

this is my code

https://github.com/huyanbin/flow_test

huyanbin avatar Nov 03 '21 15:11 huyanbin

Hi @huyanbin ! In order to better help you with this, could you please give me access to your projects code https://github.com/huyanbin/flow_test so I can take a look? 🙂

JeffreyDoyle avatar Nov 11 '21 00:11 JeffreyDoyle