Comments (8)
For a moment I thought the problem was caused by me by creating the canisters manually, so I deleted them and ran
dfx canister create --all
which what it does is it looks-up the dfx.json file in order to properly load the source files and start the canisters properly.
However... no luck, guys!
$ dfx canister create --all
Creating canister "pub"...
"pub" canister created with canister id: "6ezpl-pyhaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q"
Creating canister "sub"...
"sub" canister created with canister id: "a5gvd-vyiaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q"
$ sh test.sh
Building canisters...
Build failed. Reason:
Build step failed for canister 6ezpl-pyhaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q with error: Build failed. Reason:
Command "/home/miguelemosreverte/.cache/dfinity/versions/0.6.10/moc" "/home/miguelemosreverte/Desktop/motoko/examples/motoko/pubsub/src/pub/main.mo" "-o" "/home/miguelemosreverte/Desktop/motoko/examples/motoko/pubsub/.dfx/local/canisters/pub/pub.did" "--idl" "--actor-idl" "/home/miguelemosreverte/Desktop/motoko/examples/motoko/pubsub/.dfx/local/canisters/idl/" "--actor-alias" "pub" "6ezpl-pyhaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q" "--actor-alias" "sub" "a5gvd-vyiaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q" "--package" "base" "/home/miguelemosreverte/.cache/dfinity/versions/0.6.10/base"
returned an error:
/home/miguelemosreverte/Desktop/motoko/examples/motoko/pubsub/src/pub/main.mo:8.1-22.2: type error, an actor or actor class must be the only non-imported declaration in a program
(This is a limitation of the current version.)
Installing code for canister pub, with canister_id 6ezpl-pyhaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q
An error occured:
Io(
Os {
code: 2,
kind: NotFound,
message: "No such file or directory",
},
)
cannot find method type, dfx will send message with inferred type
Replica error (code 3): IC0304: Attempt to execute a message on canister a5gvd-vyiaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q which contains no Wasm module
cannot find method type, dfx will send message with inferred type
Replica error (code 3): IC0304: Attempt to execute a message on canister a5gvd-vyiaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q which contains no Wasm module
cannot find method type, dfx will send message with inferred type
Replica error (code 3): IC0304: Attempt to execute a message on canister 6ezpl-pyhaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q which contains no Wasm module
cannot find method type, dfx will send message with inferred type
Replica error (code 3): IC0304: Attempt to execute a message on canister a5gvd-vyiaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q which contains no Wasm module
cannot find method type, dfx will send message with inferred type
Replica error (code 3): IC0304: Attempt to execute a message on canister 6ezpl-pyhaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q which contains no Wasm module
cannot find method type, dfx will send message with inferred type
Replica error (code 3): IC0304: Attempt to execute a message on canister a5gvd-vyiaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q which contains no Wasm module
from examples.
Finally I arrived at the conclusion that the problem could be caused by not running
dfx build
on the pub_sub folder, so I did. But still... no luck on my end!
$ dfx build
Building canisters...
Build failed. Reason:
Build step failed for canister 6ezpl-pyhaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q with error: Build failed. Reason:
Command "/home/miguelemosreverte/.cache/dfinity/versions/0.6.10/moc" "/home/miguelemosreverte/Desktop/motoko/examples/motoko/pubsub/src/pub/main.mo" "-o" "/home/miguelemosreverte/Desktop/motoko/examples/motoko/pubsub/.dfx/local/canisters/pub/pub.did" "--idl" "--actor-idl" "/home/miguelemosreverte/Desktop/motoko/examples/motoko/pubsub/.dfx/local/canisters/idl/" "--actor-alias" "pub" "6ezpl-pyhaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q" "--actor-alias" "sub" "a5gvd-vyiaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q" "--package" "base" "/home/miguelemosreverte/.cache/dfinity/versions/0.6.10/base"
returned an error:
/home/miguelemosreverte/Desktop/motoko/examples/motoko/pubsub/src/pub/main.mo:8.1-22.2: type error, an actor or actor class must be the only non-imported declaration in a program
(This is a limitation of the current version.)
from examples.
@crusso any idea how to fix this?
from examples.
The types here:
and here:
examples/motoko/pubsub/src/pub/main.mo
Lines 5 to 6 in 96dc5b0
Need to either be moved into the actor definitions, which also means adding a public
to them, or be moved into a common "Types" module that can be imported from both.
from examples.
Question, how to write tests? If I knew how to write them I could make a fork that uses Github CI and make a PR so that these simple bugs could be found at code review
from examples.
Hello, I know it does sound like a low effort comment to ask 'how to test', but in the language docs I see no mentions, and if I land over here https://github.com/dfinity/motoko-base/tree/master/test, I would still not know how to run them:
dfx test? Coming from a Scala background I would expect the two keywords to work, as in sbt test
What am I missing? Could you point me to a few links for me to study and come back with results?
Results: I firmly want to express my interest on this project and more so on making benchmarks comparisons from one example like pubsub against the exact equivalent using Scala + Akka. Adding tests to this repository is my focus right now.
from examples.
Is this how it works?
Building/testing
In test/, run
make
Taken from https://github.com/dfinity/motoko-base
from examples.
PR #52 Fixed this Issue. Closing.
from examples.
Related Issues (20)
- Azle (TypeScript) examples HOT 5
- I am unable to load image and css styles HOT 1
- Git submodule breaking on local for bitcoin dapp example HOT 5
- error could not compile `typenum` due to 160 previous errors HOT 5
- Reject text: The bitcoin API is not enabled on this subnet. HOT 3
- Fix: `rust/nft-wallet` tutorial does not work properly
- bug: many documentation links are broken due to portal reorgs. HOT 2
- bug: CI is still using dfx 0.12.0
- Error: Cannot find canister id. Please issue 'dfx canister create dbank'. HOT 2
- use of update methods HOT 1
- Motoko Ledger.get_transactions_for_principal() Please 🙏 HOT 3
- A couple of errors and questions about the `examples` repo HOT 6
- I am running to a problem when running `dfx deploy` HOT 2
- bug: Tests failing due to attempt to download outdated ICP Ledger canister version HOT 1
- NFT minting is missing the canisister id in the example. Breadcrumbsportal/docs/samples /nft.md HOT 3
- [Bug] basic_bitcoin example didn't work on dfx 0.17.0-0.18.0 HOT 2
- icrc2-swap README.md typo
- Trouble Get Canister Class Principal in Map-Bucket Example HOT 1
- NFT_WALLET fails to deploy HOT 2
- about the time for sending transaction to bitcoin network
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from examples.