Try to use Nat.fromText, but got error as below snapshot, anyone has idea about it? I am using the latest dfx 0.13.1
Ah, sorry, we need to update the moc_js interpreter used on doc web site, I think.
Thanks, same as I use it in local env
Ok, so the problem is that the doc web site is describing version 0.8.3 (because someone updated it by mistake), but the interpreter used for the examples wasn’t updated and is still on 0.7.6.
And the most recent version of dfx only ships with moc 0.7.6.
fromText function doesn’t actually exist in 0.7.6.
We’ve fixed the interpeter on the web site, but that won’t help you with dfx.
Although there documentation is now too fresh, we thought that might still be better since it now include many examples that weren’t in the 0.7.6 documentation. Hopefully dfx will ship with moc 0.8.3 reasonably soon.
If you want to use the latest Motoko version, have a look over here for instructions
Why isn’t a new release of dfx always including the most recent Motoko by default? As a user, I would probably be so naive to expect that.
dfx ships like once a month. We release more often. And we delayed the release of 0.8.x because of worries about introducing breaking changes during the SNS launch.