# Error in Principal.mo

**URL:** <https://forum.dfinity.org/t/error-in-principal-mo/20195>\
**Category:** Motoko\
**Created:** [May 23, 2023, 5:55pm UTC](https://forum.dfinity.org/t/error-in-principal-mo/20195 "2023-05-23T17:55:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [May 23, 2023, 5:55pm UTC](https://forum.dfinity.org/t/error-in-principal-mo/20195/1 "2023-05-23T17:55:41Z")

</div>

I have the following error:

```auto
$ dfx build
Building canisters...
Error: Failed while trying to build all canisters.
Caused by: Failed while trying to build all canisters.
  The build step failed for canister 'aovwi-4maaa-aaaaa-qaagq-cai' (test) with an embedded error: Failed to build Motoko canister 'test'.: Failed to compile Motoko.: Failed to run 'moc'.: The command '"/home/porton/.cache/dfinity/versions/0.14.0/moc" "/home/porton/Projects/NacDB/src/test/main.mo" "-o" "/home/porton/Projects/NacDB/.dfx/local/canisters/test/test.wasm" "-c" "--debug" "--idl" "--stable-types" "--public-metadata" "candid:service" "--actor-idl" "/home/porton/Projects/NacDB/.dfx/local/canisters/idl/" "--actor-alias" "test" "aovwi-4maaa-aaaaa-qaagq-cai" "--package" "base" ".vessel/base/f26c8064c70af292a4bf20bdea6225b9223ab0fe/src" "--package" "btree" ".vessel/btree/v0.3.1/src" "--package" "stable-rbtree" ".vessel/stable-rbtree/v0.6.1/src"' failed with exit status 'exit status: 1'.
Stdout:

Stderr:
.vessel/base/f26c8064c70af292a4bf20bdea6225b9223ab0fe/src/Principal.mo:101.52-101.56: type error [M0072], field isController does not exist in type
...

```

```auto
$ dfx --version
dfx 0.14.0
$ vessel --version
vessel 0.6.5

```

---

<div class="post-metadata">

**Author:** ![timo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/timo/32/5543_2.png) [@timo](https://forum.dfinity.org/u/timo)\
**Post date:** [May 23, 2023, 6:42pm UTC](https://forum.dfinity.org/t/error-in-principal-mo/20195/2 "2023-05-23T18:42:59Z")

</div>

Isn’t isController brand new? As of moc 0.9.1?

Dfx 0.14.0 bundles with an older moc. You might need to install the latest moc binary and set the DFX\_MOC\_PATH environment variable when calling dfx build.

---

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [May 24, 2023, 7:12am UTC](https://forum.dfinity.org/t/error-in-principal-mo/20195/3 "2023-05-24T07:12:02Z")

</div>

An alternative solution is to edit `package-set.dhall`:

```auto
  overrides =
    [
      { name = "base"
      , repo = "https://github.com/dfinity/motoko-base"
      , version = "moc-0.9.0"
      , dependencies = [] : List Text
      },
    ] : List Package

```

---

<div class="post-metadata">

**Author:** ![timo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/timo/32/5543_2.png) [@timo](https://forum.dfinity.org/u/timo)\
**Post date:** [May 24, 2023, 8:36am UTC](https://forum.dfinity.org/t/error-in-principal-mo/20195/4 "2023-05-24T08:36:08Z")

</div>

But is that enough? In package-set.dhall you specify the version of motoko-base, not of the compiler. I thought that you probably need compiler support for isController to work because it uses a new syscall `ic0.is_controller`. But maybe I’m wrong. Just guessing, I haven’t tried any of this myself.

---

<div class="post-metadata">

**Author:** ![quint](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/quint/32/40449_2.png) [@quint](https://forum.dfinity.org/u/quint)\
**Post date:** [May 24, 2023, 10:03am UTC](https://forum.dfinity.org/t/error-in-principal-mo/20195/5 "2023-05-24T10:03:18Z")

</div>

Yes, @timo is correct, support for `ic0.is_controller` was only added in `moc v0.9.1`.  
[https://github.com/dfinity/motoko/releases/tag/0.9.1](https://github.com/dfinity/motoko/releases/tag/0.9.1)

@qwertytrewq you would need at least version `0.9.1` of both the compiler and the base package.  
The `DFX_MOC_PATH` env variable allows you to do this, so you do not need to wait on a DFX release.  
[https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665)

DFX `v0.14.0` only comes with `Motoko compiler 0.8.7`.
