# Running local emulator issues

**URL:** <https://forum.flow.com/t/running-local-emulator-issues/1397>\
**Category:** 🏄🏻‍♀️ Cadence\
**Created:** [March 11, 2021, 2:49am UTC](https://forum.flow.com/t/running-local-emulator-issues/1397 "2021-03-11T02:49:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmtimper](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jmtimper](https://forum.flow.com/u/jmtimper)\
**Post date:** [March 11, 2021, 2:49am UTC](https://forum.flow.com/t/running-local-emulator-issues/1397/1 "2021-03-11T02:49:55Z")

</div>

Hey, so when trying to run a simple tutorial script locally I keep getting this error.

```auto
Failed to submit executable script: client: rpc error: code = Internal desc = failed to encode value: unsupported value: <nil>, <nil>

```

For more context, when using the flow playground I experience no issues with the code. My local machine has the cadence vs code extension installed and flow cli. I used `flow init` and `flow emulator start` to start the emulator. I am able to run the transaction and get a correct response but it only happens with the script.

```auto
import PinataPartyContract from 0xf8d6e0586b0a20c7

pub fun main() : {String : String} {
    let nftOwner = getAccount(0xf8d6e0586b0a20c7)
    // log("NFT Owner")    
    let capability = nftOwner.getCapability<&{PinataPartyContract.NFTReceiver}>(/public/NFTReceiver)

    let receiverRef = capability.borrow()
        ?? panic("Could not borrow the receiver reference")

    return receiverRef.getMetadata(id: 1)
}

```

I fairly new to blockchain and flow so I think there’s probably something simple in the configuration I’m missing. My guess is the contract isn’t importing correctly, but any help would be greatly appreciated.

I was following the medium article when running into this issue: [https://medium.com/pinata/how-to-create-nfts-like-nba-top-shot-with-flow-and-ipfs-701296944bfe](https://medium.com/pinata/how-to-create-nfts-like-nba-top-shot-with-flow-and-ipfs-701296944bfe)

---

<div class="post-metadata">

**Author:** ![jimhitch](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/jimhitch/32/405_2.png) [@jimhitch](https://forum.flow.com/u/jimhitch)\
**Post date:** [April 6, 2021, 9:27pm UTC](https://forum.flow.com/t/running-local-emulator-issues/1397/2 "2021-04-06T21:27:43Z")

</div>

Hi @jmtimper!

I ran into the same problem following that tutorial.

Two changes made the script work for me. Here they are…

> **Use flow-cli's new script command format**
>
> ⚠Heads up, be sure you’re running the latest flow-cli ([0.16.0](https://github.com/onflow/flow-cli/releases)). There was a breaking change for script execution in [0.15.0](https://github.com/onflow/flow-cli/releases/tag/v0.15.0).
> 
> The medium tutorial says to run this command:
> 
> > flow scripts execute ./scripts/CheckTokenMetadata.cdc
> 
> However, this is no longer the way. Run this to see the help docs:
> 
> > flow scripts execute --help
> 
> This is the new format:
> 
> > flow scripts execute --code=scripts/CheckTokenMetadata.cdc

> **Ensure the token was properly minted**
>
> Even using the new script API won’t work if the token wasn’t properly minted. I’m not sure what I did wrong, but I kept seeing this in the emulator terminal when running the script:
> 
> > WARN[0004] **ERR** [f0fd70] Execution failed:
> > 
> > error: cannot find declaration `PinataPartyContract` in `f8d6e0586b0a20c7.PinataPartyContract
> 
> To resolve this, I followed these steps:
> 
> - ♻Stop and restart the emulator.
> - run the deploy command again.
> - run the transaction to mint the NFT again
> - run the script again
> - 🥳See the metadata!
> 
> A happy log stream in the emulator terminal should look like this:
> 
> ![CleanShot 2021-04-06 at 16.20.36@2x](https://us1.discourse-cdn.com/flex022/uploads/flow/original/1X/12ce10a5620a52ec7e7022c99908b5ce5c473d26.png)

Best of luck to you as you learn!

---

<div class="post-metadata">

**Author:** ![krzysio94598](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/krzysio94598/32/425_2.png) [@krzysio94598](https://forum.flow.com/u/krzysio94598)\
**Post date:** [April 19, 2021, 12:53am UTC](https://forum.flow.com/t/running-local-emulator-issues/1397/3 "2021-04-19T00:53:56Z")

</div>

I am on version v0.17.0 and I have the same issue. I followed all recommended steps and I am still not able to get rid of this error. Any ideas?

---

<div class="post-metadata">

**Author:** ![krzysio94598](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/krzysio94598/32/425_2.png) [@krzysio94598](https://forum.flow.com/u/krzysio94598)\
**Post date:** [April 25, 2021, 1:22am UTC](https://forum.flow.com/t/running-local-emulator-issues/1397/4 "2021-04-25T01:22:18Z")

</div>

I finally tried this and this fixed my issue:

```auto
flow accounts add-contract <name> <filename>

```

---

<div class="post-metadata">

**Author:** ![uriwashere](https://avatars.discourse-cdn.com/v4/letter/u/8491ac/32.png) [@uriwashere](https://forum.flow.com/u/uriwashere)\
**Post date:** [May 14, 2021, 6:54am UTC](https://forum.flow.com/t/running-local-emulator-issues/1397/5 "2021-05-14T06:54:39Z")

</div>

Could you elaborate?
