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

extension does not recognize canister alias when project is in subdirectory #186

Closed
letmejustputthishere opened this issue Mar 8, 2023 · 5 comments

Comments

@letmejustputthishere
Copy link
Member

consider the following structure

my-monorepo/
  |- package.json
  |- yarn.lock
  |- workspaces/
      |- canister/
          |- Cargo.toml
          |- src/
      |- proxy/
          |- package.json
          |- src/

when importing a canister using the canister:canister_name syntax, when i launch vscode from within the my-monorepo folder, the following error appears
Screenshot 2023-03-08 at 15 45 13
when launching vscode from within the canister folder, everything works as expected.

@rvanasa
Copy link
Contributor

rvanasa commented Mar 8, 2023

Thank you for all these bug reports! I will include this in the backlog for the next time I get a chance to improve the extension (currently juggling a lot of projects).

If anyone else encounters this issue, please feel free to +1 this issue so I can get a sense for how this should be prioritized. Thanks!

@ZenVoich
Copy link
Contributor

Probably same issue, but I get different error:
image

dfx.json:

{
  "version": 1,
  "canisters": {
    "staging": {
      "type": "motoko",
      "main": "src/main.mo",
      "declarations": {
        "output": "declarations/main"
      },
      "dependencies": [
        "ledger"
      ]
    },
    "ledger": {
      "type": "custom",
      "wasm": "./declarations/ledger/ledger.wasm",
      "candid": "./declarations/ledger/ledger.private.did",
      "remote": {
        "candid": "./declarations/ledger/ledger.public.did",
        "id": {
          "ic": "ryjl3-tyaaa-aaaaa-aaaba-cai"
        }
      }
    },
    "production": {
      "type": "motoko",
      "main": "src/main.mo",
      "dependencies": [
        "ledger"
      ]
    }
  },
  "defaults": {
    "build": {
      "packtool": "vessel sources",
      "args": "--trap-on-call-error"
    }
  }
}

dfx deploy works well

@letmejustputthishere
Copy link
Member Author

@rvanasa seems like the .dfx/local/lsp files don't get updated when you deploy a canister using --mode reinstall.
steps to reproduce:

  1. deploy ledger with private did
  2. update dfx.json to public did
  3. deploy ledger dependent canister with --mode reinstall
  4. above error message is shown

@rvanasa
Copy link
Contributor

rvanasa commented Apr 3, 2023

Thanks for the repro; this appears to be directly caused by the issue tracked in dfinity/sdk#2996, dfinity/sdk#2969, and SDK-1019. Would it be okay if I closed this to help consolidate the conversation?

@letmejustputthishere
Copy link
Member Author

sure :)

@rvanasa rvanasa closed this as completed Apr 4, 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

No branches or pull requests

3 participants