Importing Timer in Motoko, and using moc 0.7.5 with dfx 0.13.0-beta.2

I updated dfx to dfx 0.13.0-beta.2 to use Motoko Timer.

I noticed a couple of things:

import error [M0009], file ".mops/_github/base@moc-0.7.4/src/Timers/lib.mo" does not exist

it seems to still be using moc 0.7.4 instead of 0.7.5. I’m told the binary of moc can be downloaded but is this expected behaviour?

Also, not sure if it’s Timer or Timers. It seems to be used both ways:

(motoko/timers.md at master · dfinity/motoko · GitHub)

(motoko-base/Timer.mo at master · dfinity/motoko-base · GitHub)

It looks like the base package resolved to 0.7.4
You can try to install latest base package which includes Timer.mo file:

mops add base

It didn’t complain but on deploy I still got

import error [M0009], file ".mops/_github/base@moc-0.7.4/src/Timer/lib.mo" does not exist

This is the import statement:

import Timer "mo:base/Timer";

Could you show me the contents of your mops.toml file?

You can try to remove base = ... line from your mops.toml file and run mops add base again.

1 Like

:ok_hand:

Much appreciated.

I somehow had this in there…:

base = "https://github.com/dfinity/motoko-base#moc-0.7.4"

1 Like