I tried to import Canister2 deployed on local network in Canister1 as module , Canister 2 is build in another project, so I tried as import Canister2 “canister:canister2”;
when I deploy canister 1 , the error shows as import error [M0011], canister alias “canister2” not defined
so what I should do to correct import canister 2 ?
In your local dev environment, if you need to start clean then deploying projects in the same order every time will ensure the assigned canister id doesn’t change.
(For your production deployment, note the mainnet canister id will be different to the locally deployed one so you’ll have to account for that.)