Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

canister alias "ledger" not defined #53

Closed
maxm224 opened this issue Sep 25, 2022 · 7 comments · Fixed by #64
Closed

canister alias "ledger" not defined #53

maxm224 opened this issue Sep 25, 2022 · 7 comments · Fixed by #64

Comments

@maxm224
Copy link

maxm224 commented Sep 25, 2022

When importing the ledger canister, I get the following error highlight "canister alias "ledger" not defined". The canister is defined in dfx.json. When I compile, I do not get an error and I am also able to successfully call ledger methods in local development and on the production version.
Also only the import error is highlighted, no other errors that are present in the file are highlighted.

@rvanasa
Copy link
Contributor

rvanasa commented Sep 27, 2022

Would you mind sending the relevant parts of your dfx.json file? I'll look into fixing this for you.

@maxm224
Copy link
Author

maxm224 commented Sep 27, 2022

Thanks! This is the ledger part:

"ledger": {
    "type": "custom",
    "candid": "src/ledger/ledger.did",
    "wasm": "src/ledger/ledger.wasm",
    "remote": {
      "candid": "src/ledger/ledger.public.did",
      "id": {
        "ic": "ryjl3-tyaaa-aaaaa-aaaba-cai"
      }
    }
},

@rvanasa
Copy link
Contributor

rvanasa commented Sep 27, 2022

Do you run into the same problem if you switch to dfx version v0.11.0 or earlier in the dfx.json file (and then restart the language server)?

@maxm224
Copy link
Author

maxm224 commented Sep 28, 2022

Yes, if I downgrade dfx to version 0.11.0 and specify 0.11.0 in dfx.json, I get the same error. If I have just specify 0.11.0 in dfx.json and stay on dfx 0.11.2. No errors are shown, including ones that are obviously wrong. So the language server does not seem to work then.

@borovan
Copy link

borovan commented Sep 28, 2022

image

we get the same

  "canisters": {
    "main": {
      "main": "src/backend/main/gen/Actor.mo",
      "type": "motoko",
      "dependencies": [
        "content_factory",
        "global_factory",
        "instance_factory",
        "player_factory"
      ]
    },
    "cdn": {
      "main": "src/backend/cdn/Container.mo",
      "type": "motoko"
    },
    "content_factory": {
      "main": "src/backend/service/content/gen/Factory.mo",
      "type": "motoko"
    },
    "global_factory": {
      "main": "src/backend/service/global/gen/Factory.mo",
      "type": "motoko"
    },
    "instance_factory": {
      "main": "src/backend/service/instance/gen/Factory.mo",
      "type": "motoko"
    },
    "player_factory": {
      "main": "src/backend/service/player/gen/Factory.mo",
      "type": "motoko"
    },```

@rvanasa
Copy link
Contributor

rvanasa commented Oct 8, 2022

Let me know if this works in v0.4.8 (after running dfx deploy).

Multi-canister projects now work in certain situations, but I'm sure there will still be a few corner cases to figure out.

Reopening for visibility.

Cheers!

@rvanasa rvanasa reopened this Oct 8, 2022
@maxm224
Copy link
Author

maxm224 commented Oct 9, 2022

Yes, for me it is not showing an error anymore. This really improves the usability, thanks!!

@rvanasa rvanasa closed this as completed Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants