# Error in Scope While Importing From Local File

**URL:** https://forum.flow.com/t/error-in-scope-while-importing-from-local-file/1898
**Category:** 🏄🏻‍♀️ Cadence
**Created:** [May 11, 2021, 1:48pm UTC](https://forum.flow.com/t/error-in-scope-while-importing-from-local-file/1898 "2021-05-11T13:48:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![johnsmith1963](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@johnsmith1963](https://forum.flow.com/u/johnsmith1963)
#### Post date: [May 11, 2021, 1:48pm UTC](https://forum.flow.com/t/error-in-scope-while-importing-from-local-file/1898/1 "2021-05-11T13:48:54Z")

</div>

Hey all - me and my team are new to flow - and having a bit of trouble with creating our own smart contracts. We are trying to follow along with the developer tutorial - but we are current stuck when trying to import a public contract from another local file. We receive the following error:

```auto
INFO[0956] ⭐ Transaction executed txID=150a23a2841430ee88d6e3122b78fe69162ac6ac4dcc4c6a2b7cab3b981aee6a
WARN[0956] ❗ Transaction reverted txID=af2be854035f27b38ce5bf8cd2ddc8ecb585d86a0286424ea80518b5726ae1f3
WARN[0956] ERR [af2be8] Execution failed:
error: cannot deploy invalid contract
  --> af2be854035f27b38ce5bf8cd2ddc8ecb585d86a0286424ea80518b5726ae1f3:11:3
   |
11 | acct.contracts.add(name: contract, code: contracts[contract]!.decodeHex())
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: cannot find type in this scope: `FungibleToken`
 --> e03daebed8ca0615.EngramToken:3:26
  |
3 | pub contract EngramToken: FungibleToken {
  | ^^^^^^^^^^^^^ not found in this scope

```

EngramToke.cdc has:

```auto
import FungibleToken from "./FungibleToken.cdc"

pub contract EngramToken: FungibleToken {
}

```

And FungibleToken.cdc has:

```auto
pub contract interface FungibleToken {
    ....
}

```

Both .cdc files live within the same folder level.

I noticed while reading the docs here: [link](https://docs.onflow.org/cadence/language/imports/) that:

> Status: Imports from local files are not currently implemented.

Could this be the reason for our import error?

Just curious if anyone has run into a similar issue. Thanks!

---

<div class="post-metadata">

### Author: ![bastian](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/bastian/32/183_2.png) [@bastian](https://forum.flow.com/u/bastian)
#### Post date: [May 11, 2021, 5:37pm UTC](https://forum.flow.com/t/error-in-scope-while-importing-from-local-file/1898/2 "2021-05-11T17:37:38Z")

</div>

Hi John!

The CLI now supports deploying contracts using file names, it deploys the contracts and rewrites the imports to the addresses where the imported contracts were deployed to. Are you using this feature?

I’ll update the outdated status note in the documentation.

---

<div class="post-metadata">

### Author: ![sideninja](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/sideninja/32/363_2.png) [@sideninja](https://forum.flow.com/u/sideninja)
#### Post date: [May 11, 2021, 7:10pm UTC](https://forum.flow.com/t/error-in-scope-while-importing-from-local-file/1898/3 "2021-05-11T19:10:06Z")

</div>

Hi John,

you can import contracts from a local file just make sure you use Flow CLI project functionality.

You can read more about it here: [Deploy a Flow Project - Flow Documentation](https://docs.onflow.org/flow-cli/deploy-project-contracts/)

But explained simply you need to create flow.json file in which you specify your improts and location where that files are and then run `flow project deploy`.

Your flow.json will probably look like:

```auto
{
  // ... other content in the flow.json - generate it by running: flow init
  "contracts": {
    "EngramToken": "location to your contract",
    "FungibleToken": "./cadence/contracts/FungibleToken.cdc"
  },
  "deployments": {
    "emulator": {
      "emulator-account": ["FungibleToken", "EngramToken"]
    }
  },
  ...
}

```

---

<div class="post-metadata">

### Author: ![johnsmith1963](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@johnsmith1963](https://forum.flow.com/u/johnsmith1963)
#### Post date: [May 12, 2021, 1:14pm UTC](https://forum.flow.com/t/error-in-scope-while-importing-from-local-file/1898/4 "2021-05-12T13:14:34Z")

</div>

Thank you @sideninja and @bastian ! You guys were right on the money - we weren’t using a flow project - rather just running the go code using the go tools directly.

We changed the code to use dynamic references for now - and will migrate it to use a Flow CLI project soon.

Thank you for your replies!
