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

**URL:** <https://forum.flow.com/t/flow-js-testing-failed-with-error-error-code-1054/2269>\
**Category:** Uncategorized\
**Created:** [August 6, 2021, 8:03am UTC](https://forum.flow.com/t/flow-js-testing-failed-with-error-error-code-1054/2269 "2021-08-06T08:03:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shanmugam](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@shanmugam](https://forum.flow.com/u/shanmugam)\
**Post date:** [August 6, 2021, 8:03am UTC](https://forum.flow.com/t/flow-js-testing-failed-with-error-error-code-1054/2269/1 "2021-08-06T08:03:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MaxStarka](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/maxstarka/32/56_2.png) [@MaxStarka](https://forum.flow.com/u/MaxStarka)\
**Post date:** [August 7, 2021, 9:19pm UTC](https://forum.flow.com/t/flow-js-testing-failed-with-error-error-code-1054/2269/2 "2021-08-07T21:19:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shanmugam](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@shanmugam](https://forum.flow.com/u/shanmugam)\
**Post date:** [August 9, 2021, 8:18am UTC](https://forum.flow.com/t/flow-js-testing-failed-with-error-error-code-1054/2269/3 "2021-08-09T08:18:33Z")

</div>

> [@shanmugam](#):
>
> 1054

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 🙂

---

<div class="post-metadata">

**Author:** ![beppeben](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@beppeben](https://forum.flow.com/u/beppeben)\
**Post date:** [January 9, 2022, 7:00pm UTC](https://forum.flow.com/t/flow-js-testing-failed-with-error-error-code-1054/2269/4 "2022-01-09T19:00:25Z")

</div>

Same problem here, all import statements fail with 1054 in the testing framework, while they succeed when used directly in the emulator.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/andrea/32/607_2.png) [@andrea](https://forum.flow.com/u/andrea)\
**Post date:** [January 12, 2022, 11:27am UTC](https://forum.flow.com/t/flow-js-testing-failed-with-error-error-code-1054/2269/5 "2022-01-12T11:27:22Z")

</div>

Hey @beppeben, did you try @shanmugam’s solution of trying both deployment and transaction from flow-js-testing? (comment above yours)

@shanmugam would be great if you can explain your fix in a little more detail!
