Flow-js-testing failed with error Error Code: 1054

Flow-js-testing ended with error Error Code: 1054

 thrown: "execution error code 1101: [Error Code: 1101] cadence runtime error Execution failed:
    error: [Error Code: 1054] location (null) is not a valid location: expecting an AddressLocation, but other location types are passed
    --> null

This happens when I use an import statement. Code without import statement works fine.

If i print the code from getContractCode() / getTransactionCode(), it contains the import statement with emulator address

import NonFungibleToken from 0xf8d6e0586b0a20c7

But deployContract()/sendTransaction() returns error 1054. deployContractByName() also returns same error

My code works fine with commands “flow project deploy”, it deploys contracts in an emulator account. “flow transactions send mytrans,cdc”, executes my transactions fine. My contract and transactions are working fine in emulator and testnet. In flow-js-testing I am facing the issue

thrown: "execution error code 1101: [Error Code: 1101] cadence runtime error Execution failed:
    error: [Error Code: 1054] location (null) is not a valid location: expecting an AddressLocation, but other location types are passed
    --> null

Cli version : v0.26.0
Flow-js-testing : ^0.1.12

Please help. Thanks in advance

Can you post some of the example tests you have here?

Hi MaxStarka, thanks for answering, i got a solution for this, at first i deployed contracts using command “flow project deploy” then tried transactions in flow-js-testing sendTransaction() with addressMap. It returned error 1054. it was confused me.

After that i tried both deployment and transaction from flow-js-testing, it is working fine.

Thanks :slight_smile: